Skip to content

Instantly share code, notes, and snippets.

@headius
Created February 5, 2018 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/5c3b25bdd1fbca47513416223e82861a to your computer and use it in GitHub Desktop.
Save headius/5c3b25bdd1fbca47513416223e82861a to your computer and use it in GitHub Desktop.
JRuby base startup under Hotspot and OpenJ9 (with OpenJDK 8)
Hotspot:
root@87006c934ea0:~/jruby# time jruby -e 1
real 0m1.469s
user 0m3.440s
sys 0m0.210s
root@87006c934ea0:~/jruby# time jruby -e 1
real 0m1.470s
user 0m3.310s
sys 0m0.160s
root@87006c934ea0:~/jruby# time jruby --dev -e 1
real 0m1.185s
user 0m1.610s
sys 0m0.130s
root@87006c934ea0:~/jruby# time jruby --dev -e 1
real 0m1.151s
user 0m1.500s
sys 0m0.220s
OpenJ9:
root@87006c934ea0:~/jruby# time jruby -e 1
real 0m2.568s
user 0m3.840s
sys 0m0.600s
root@87006c934ea0:~/jruby# time jruby -e 1
real 0m2.489s
user 0m4.010s
sys 0m0.330s
root@87006c934ea0:~/jruby# time jruby -J-Xquickstart -e 1
real 0m1.798s
user 0m2.680s
sys 0m0.110s
root@87006c934ea0:~/jruby# time jruby -J-Xquickstart -e 1
real 0m1.797s
user 0m2.710s
sys 0m0.080s
root@87006c934ea0:~/jruby# time jruby -J-Xquickstart -J-Xshareclasses -e 1
real 0m2.562s
user 0m3.630s
sys 0m0.890s
root@87006c934ea0:~/jruby# time jruby -J-Xquickstart -J-Xshareclasses -e 1
real 0m1.423s
user 0m1.910s
sys 0m0.150s
root@87006c934ea0:~/jruby# time jruby -J-Xquickstart -J-Xshareclasses -e 1
real 0m1.312s
user 0m1.750s
sys 0m0.060s
@DanHeidinga
Copy link

Can you run with java -Xshareclasses:destroy to destroy the current sharedclasses cache? The default sized cache is fairly small and jruby fills it up.

If you run with time ./jruby -J-Xshareclasses -J-Xscmx100m -J-Xquickstart -e 1 after destroying the cache? This creates a large cache and uses quickstart. Check the numbers after a couple of runs to ensure that the rom classes / aot code has been stored.

You can also check how full the cache is using -Xsharedclasses:printStats or -Xsharedclasses:printAllStats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment