Skip to content

Improving startup time

alandipert edited this page Nov 26, 2014 · 6 revisions

Improving startup time

JVM startup time is a complex topic. While some JVM options can speed startup, they may also have a negative impact on other things like the ability to profile, overall GC performance, or security. For simplicity, the boot executable sets no JVM options by default. Leiningen does set options, which is why boot will feel slower for new users coming from Leiningen. We may want to reevaluate this decision in the future. Recent versions of JRuby provide a --dev option that sets JVM options to their speediest values.

In the meantime, users can set options locally to significantly improve boot's startup time.

Alan's Tests

On 11/126/2014 I tried three different BOOT_JVM_OPTIONS using the following setup:

  • MacBookPro10,2 running OS X 10.10.1
  • Java 1.8.0_25
  • boot 2.0.0-pre27

I started boot 10 times for each option value and averaged the results. The snippet I ran to test was:

for i in {1..10}; do time boot show -E; done &> results.txt
  • unset BOOT_JVM_OPTIONS
    • Average startup: 3.33s
    • Comment: No options.
  • export BOOT_JVM_OPTIONS="-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2g -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
    • Average startup: 2.17s
    • Comment: typical Leiningen options
  • export BOOT_JVM_OPTIONS="-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx2g -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Xverify:none"
    • Average startup: 1.75s
    • Comment: uses -Xverify:none which maybe is bad?

References

Clone this wiki locally