[ 
https://issues.apache.org/jira/browse/IGNITE-27698?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Aleksandr Polovtsev updated IGNITE-27698:
-----------------------------------------
    Description: 
{{FastTimestamps}} class uses {{System.currentTimeMillis}} for obtaining the 
current timestamp. However, in the code we use this class to compute 
_durations_, which is not recommended to be done using {{currentTimeMillis}} as 
it is not monotonic and subject to NTP leaps. It is proposed to replace all 
usages of {{FastTimestamps}} where it is used to compute durations.

Depending on the benchmark results, the following approach should be used:
1. Try to use {{System.nanoTime}} directly everywhere;
2. If benchmarks show any degradations, introduce a class similar to 
{{FastTimestamps}}, but which will use {{System.nanoTime}} internally.

> Replace incorrect usages of FastTimestamps
> ------------------------------------------
>
>                 Key: IGNITE-27698
>                 URL: https://issues.apache.org/jira/browse/IGNITE-27698
>             Project: Ignite
>          Issue Type: Improvement
>            Reporter: Aleksandr Polovtsev
>            Priority: Major
>              Labels: ignite-3
>
> {{FastTimestamps}} class uses {{System.currentTimeMillis}} for obtaining the 
> current timestamp. However, in the code we use this class to compute 
> _durations_, which is not recommended to be done using {{currentTimeMillis}} 
> as it is not monotonic and subject to NTP leaps. It is proposed to replace 
> all usages of {{FastTimestamps}} where it is used to compute durations.
> Depending on the benchmark results, the following approach should be used:
> 1. Try to use {{System.nanoTime}} directly everywhere;
> 2. If benchmarks show any degradations, introduce a class similar to 
> {{FastTimestamps}}, but which will use {{System.nanoTime}} internally.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to