This should go up on a blog postOn Mon, Apr 15, 2013 at 2:09 PM, mojavelinux [via Asciidoctor :: Discussion] <[hidden email]> wrote:
For small tasks, such as converting an AsciiDoc document, there are certain flags you can enable for JRuby and Java that make it startup much, much faster, esp when invoked via Java (like 3x as fast). The trade-off is that you are disabling optimizations that impact long-running processes, but...exactly, we don't need them.Here's the set of flags I've worked out thus far:-Djruby.compat.version=RUBY1_9 -Djruby.compile.mode=OFF -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none
Here's an example of making a simple JRuby call without these flags:time jruby -e 'puts "Hello, World!"'real 0m1.170suser 0m1.966ssys 0m0.078sNow I'll add these flags,export JRUBY_OPTS="-Djruby.compat.version=RUBY1_9 -Djruby.compile.mode=OFF -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xverify:none"
and call the same script again:time jruby -e 'puts "Hello, World!"'real 0m0.090suser 0m0.070ssys 0m0.021sThat certainly speeds things up.Now, I'll execute the generate-resources goal in Maven to invoke the Asciidoctor Maven plugin, first without any flags:real 0m7.361suser 0m14.733ssys 0m0.297sNow I'll add the flags. The only way I can figure out to pass these flags to JRuby is to set them as Maven options:real 0m3.310suser 0m4.537ssys 0m0.260sVoila! I think that will certainly save a lot of waiting :)If anyone knows:a. Flags that can make it go even fasterb. How to pass flags to JRuby w/o having to apply them to Maven globallyplease let us know!-Dan--
Dan AllenPrincipal Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597
If you reply to this email, your message will be added to the discussion below:http://discuss.asciidoctor.org/Faster-JRuby-execution-tp130.htmlTo start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML--
If you reply to this email, your message will be added to the discussion below:http://discuss.asciidoctor.org/Faster-JRuby-execution-tp130p131.htmlTo start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML
Free forum by Nabble | Edit this page |