-
-
Notifications
You must be signed in to change notification settings - Fork 180
Improving startup time
export BOOT_JVM_OPTIONS="-client
-XX:+TieredCompilation
-XX:TieredStopAtLevel=1
-Xmx2g
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled
-Xverify:none"
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.
On 11/26/2014 I tried three different BOOT_JVM_OPTIONS
using the following setup:
- MacBookPro10,2 running OS X 10.10.1
- Oracle JDK 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?
Model Identifier: MacBookPro10,2
Processor Name: Intel Core i5
Processor Speed: 2.6 GHz
Number of Processors: 1
Total Number of Cores: 2
L2 Cache (per Core): 256 KB
L3 Cache: 3 MB
Memory: 8 GB
time env BOOT_JVM_OPTIONS= boot2
3.80 real 10.69 user 0.56 sys
time env BOOT_JVM_OPTIONS="-client -Xmx2g -Xverify:none
-XX:+TieredCompilation -XX:TieredStopAtLevel=1
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled" boot2
2.09 real 4.14 user 0.27 sys
You can find other developers and users in the #hoplon
channel on freenode IRC or the boot slack channel.
If you have questions or need help, please visit the Discourse site.
- Environments
- Boot environment
- Java environment
- Tasks
- Built-ins
- Third-party
- Tasks Options
- Filesets
- Target Directory
- Pods
- Boot Exceptions
- Configuring Boot
- Updating Boot
- Setting Clojure version
- JVM Options
- S3 Repositories
- Scripts
- Task Writer's Guide
- Require inside Tasks
- Boot for Leiningen Users
- Boot in Leiningen Projects
- Repl reloading
- Repository Credentials and Deploying
- Snippets
- Troubleshooting
- FAQ
- API docs
- Core
- Pod
- Util