-
Enhancement
-
Resolution: Won't Fix
-
P3
-
hs16
-
generic
-
os_x, solaris_10
###@###.### wrote:
...
> Given gethrtime is _supposed_ to be monotonic and that bugs whereby
> it is not monotonic get addressed, and given this code is actually
> performance sensitive - as the changes in 6784100 demonstrated - then
> shouldn't we add a flag AlwaysdUseOSHighResTime so that we just use
> gethrtime() directly? This flag could be used by people who care
> about the performance and know enough about it to check that they
> have the right patches for gethrtime() to be assumed to be working
> correctly. Default value of the flag would be false of course :)
I did the experiment to return the result of gethrtime() without caching and got almost 6x improvement on x86!!!!!!
inline hrtime_t getTimeNanos() {
if (VM_Version::supports_cx8()) {
const hrtime_t now = gethrtime();
+ if (UseNewCode) return now;
I got ScaleHarness.java test from 6784100.
32-bit product VM System.nanoTime()
% gamma ScaleHarness -X 8 n
-XX:-UseNewCode
5614000 in 1010
5612000 in 1010
5613000 in 1010
-XX:+UseNewCode
31611000 in 1010
31606000 in 1010
31612000 in 1010
...
> Given gethrtime is _supposed_ to be monotonic and that bugs whereby
> it is not monotonic get addressed, and given this code is actually
> performance sensitive - as the changes in 6784100 demonstrated - then
> shouldn't we add a flag AlwaysdUseOSHighResTime so that we just use
> gethrtime() directly? This flag could be used by people who care
> about the performance and know enough about it to check that they
> have the right patches for gethrtime() to be assumed to be working
> correctly. Default value of the flag would be false of course :)
I did the experiment to return the result of gethrtime() without caching and got almost 6x improvement on x86!!!!!!
inline hrtime_t getTimeNanos() {
if (VM_Version::supports_cx8()) {
const hrtime_t now = gethrtime();
+ if (UseNewCode) return now;
I got ScaleHarness.java test from 6784100.
32-bit product VM System.nanoTime()
% gamma ScaleHarness -X 8 n
-XX:-UseNewCode
5614000 in 1010
5612000 in 1010
5613000 in 1010
-XX:+UseNewCode
31611000 in 1010
31606000 in 1010
31612000 in 1010
- relates to
-
JDK-8040140 System.nanoTime() is slow and non-monotonic on OS X
- Closed
-
JDK-6863420 os::javaTimeNanos() go backward on Solaris x86
- Closed
-
JDK-6876279 currentTimeMillis and nanoTime are too expensive
- Closed
-
JDK-6784100 getTimeNanos - CAS reduction
- Closed
-
JDK-6868976 Sequester os_solaris.cpp'max_hrtime to its own cache line
- Closed