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


   For the sake of posterity, here are the results for 
`benchmarkThreadCpuTimer` with and without changes on my MacBook:
   
   DCE:
   ```java
     @Benchmark
     public void benchmarkThreadCpuTimer() {
       ThreadTimer threadTimer = new ThreadTimer();
       long totalThreadCpuTimeNs = threadTimer.getThreadTimeNs();
     }
   ```
   
   ```
   Benchmark                               Mode  Cnt  Score   Error  Units
   BenchmarkTimer.benchmarkThreadCpuTimer  avgt    5  0.523 ± 0.106  ns/op
   ```
   
   Blackhole, measurement disabled:
   
   ```java
     @Benchmark
     public long benchmarkThreadCpuTimer() {
       ThreadTimer threadTimer = new ThreadTimer();
       return threadTimer.getThreadTimeNs();
     }
   ```
   
   ```
   Benchmark                               Mode  Cnt  Score   Error  Units
   BenchmarkTimer.benchmarkThreadCpuTimer  avgt    5  1.988 ± 0.151  ns/op
   ```
   
   Blackhole, measurement enabled:
   
   ```java
     @Setup(Level.Trial)
     public void setup() {
       ThreadTimer.setThreadCpuTimeMeasurementEnabled(true);
     }
   
     @Benchmark
     public long benchmarkThreadCpuTimer() {
       ThreadTimer threadTimer = new ThreadTimer();
       return threadTimer.getThreadTimeNs();
     }
   ```
   
   ```
   Benchmark                               Mode  Cnt     Score     Error  Units
   BenchmarkTimer.benchmarkThreadCpuTimer  avgt    5  2382.225 ± 304.219  ns/op
   ```
   
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to