You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2021/09/09 16:52:54 UTC

[GitHub] [pinot] richardstartin commented on issue #7414: Tracing should not rely on the system clock

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-unsubscribe@pinot.apache.org

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



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