richardstartin commented on issue #7414:
URL: https://github.com/apache/pinot/issues/7414#issuecomment-916270036


   > `System.currentTimeMillis()` was more efficient than nanos
   
   This is the first time I have heard that and I must admit I am very 
skeptical about those articles' claims. On linux, `System.currentTimeMillis` 
delegates to `CLOCK_REALTIME` (see 
[here](https://github.com/openjdk/jdk/blob/20a373a0d00b72f0c6dceb19efca3b7cc34335e5/src/hotspot/os/posix/os_posix.cpp#L1387))
 whereas `System.nanoTime()` delegates to `CLOCK_MONOTONIC` 
([here](https://github.com/openjdk/jdk/blob/20a373a0d00b72f0c6dceb19efca3b7cc34335e5/src/hotspot/os/posix/os_posix.cpp#L1409)).
 There are [faster 
clocks](https://people.cs.rutgers.edu/~pxk/416/notes/c-tutorials/gettime.html) 
than `CLOCK_MONOTONIC` but Java users don't have access to them. Performance 
wise, the dominating factor in time measurement tends to be whether the 
`clock_gettime ` syscall is mapped into userspace by vDSO or not, and e.g. Xen 
doesn't do that, which can confound measurement.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to