JFR intrinsics have access to it as well, but nanotime() doesn't use it, which seemed odd to me.
Out of curiosity, how long do nanotime() calls on Zing take? On Tuesday, April 30, 2019 at 2:52:18 AM UTC-7, Nitsan Wakart wrote: > > Zing has the option to do just that on systems which reliably support it > (-XX:+UseRdtsc IIRC). So yes it can be done, and is sometimes even the > right thing to do. > > On Tue, Apr 30, 2019 at 7:50 AM dor laor <[email protected] <javascript:>> > wrote: > >> It might be since in the past many systems did not have a stable rdtsc >> and thus if the instruction is executed >> on different sockets it can result in wrong answers and negative time. >> Today most systems do have a stable tsc >> and you can verify it from userspace/java too. >> I bet it's easy to google the reason >> >> On Mon, Apr 29, 2019 at 2:36 PM 'Carl Mastrangelo' via >> mechanical-sympathy <[email protected] <javascript:>> wrote: >> >>> This may be a dumb question, but why (on Linux) is System.nanotime() a >>> call out to clock_gettime? It seems like it could be inlined by the JVM, >>> and stripped down to the rdtsc instruction. From my reading of the vDSO >>> source for x86, the implementation is not that complex, and could be copied >>> into Java. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "mechanical-sympathy" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] >>> <javascript:>. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "mechanical-sympathy" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "mechanical-sympathy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
