Boost Startup and Java/FileBot/Groovy Performance Tuning
Posted: 19 Mar 2014, 16:08
Level: Advanced
Here's an interesting article on how to improve JVM startup speeds:
https://github.com/jruby/jruby/wiki/Imp ... artup-time
On my DS213j (ARM) it takes 2500ms to run filebot without CDS, and it goes down to 1900ms with CDS.
CDS (class data sharing) is enabled by default, you may need to generate the shared class data once with this command once:
On 32-bit system the Client VM is default. That's already optimized for initial speed. I've tried -client and -server options and it takes 25s and 45s respectively to initialize FileBot/Groovy and run scripts. Somehow Groovy class loading is really slow on my ARM-powered NAS.
On 64-bit systems where only the Server VM is available these options can boost startup speed at the expense of runtime performance:
Especially if you're calling FileBot Groovy scripts on a 64-bit systems then these options can really do make a big difference for startup performance.
e.g. calling time filebot yields the following results:
Server VM:
Server VM with -XX:+TieredCompilation -XX:TieredStopAtLevel=1 (this should then work similar to the Client VM then)
Although runtime performance will be lower, saving 4s right out of the box for every script call is probably worth it. 
Here's an interesting article on how to improve JVM startup speeds:
https://github.com/jruby/jruby/wiki/Imp ... artup-time
On my DS213j (ARM) it takes 2500ms to run filebot without CDS, and it goes down to 1900ms with CDS.
CDS (class data sharing) is enabled by default, you may need to generate the shared class data once with this command once:
Code: Select all
java -Xshare:dump
On 64-bit systems where only the Server VM is available these options can boost startup speed at the expense of runtime performance:
Code: Select all
-XX:+TieredCompilation -XX:TieredStopAtLevel=1
e.g. calling time filebot yields the following results:
Code: Select all
time filebot -script "g:println 'Hello World'"
Code: Select all
real 0m7.086s
user 0m11.336s
sys 0m0.254s
Code: Select all
real 0m3.596s
user 0m4.632s
sys 0m0.192s
