ptlrs commented on PR #7390:
URL: https://github.com/apache/ozone/pull/7390#issuecomment-2484489600

   Thank you for the review @ayushtkn. 
   
   As you mentioned, `Time.monotonicNow()` or Java's nanotime is not an option 
here as we are not measuring elapsed time. 
   
   The other consideration is that we want to reduce the dependency on the 
Hadoop library.
   
   On the performance side, it may be too early to optimize but here are some 
rough numbers via JMH for calling `System.currentTimeMillis` and `Instant.now` 
**one million** times on my machine.
   
   The time taken to call either of the methods will not be the dominant factor 
at Ozone's scale. 
   
   ```
   Benchmark                                Mode  Cnt   Score   Error   Units
   TimeBenchmark.measureCurrentTimeMillis  thrpt        0.075          ops/ms
   TimeBenchmark.measureInstantNow         thrpt        0.051          ops/ms
   TimeBenchmark.measureCurrentTimeMillis   avgt       13.334           ms/op
   TimeBenchmark.measureInstantNow          avgt       19.823           ms/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