RFR(S) 8178351 - Simplify MetaspaceShared::is_in_shared_space and MetaspaceObj::is_shared

Ioi Lam ioi.lam at oracle.com
Tue Jan 16 00:40:16 UTC 2018


Please review the following simple fix for improving CDS start-up time:


Since all the CDS shared metaspace regions are consecutively allocated,
and we can guarantee there are no gaps where the OS can allocate new
memory into, we can just do comparisons between 2 pointers. See
allocations.hpp and metaspaceShared.hpp where these methods can be
inlined to improve start-up time when CDS is enabled.

For a simple HelloWorld test

     java -Xshare:dump
     perf stat -r java -Xshare:on -cp . HelloWorld > /dev/null

We see about 1% speed up on my dual-core Haswell box. As usual, YMMV.

     BEFORE: 187,757,752 cycles, 0.048169533 sec
     AFTER:  185,770,302 cycles, 0.047497524 sec

I also did some incidental code clean up.

Testing with hs_tier{1,2,3} now.

- Ioi

More information about the hotspot-runtime-dev mailing list