[jruby] profiling jruby code ? faster startup ?

Keith Bennett keithrbennett at gmail.com
Thu Feb 21 11:07:33 JST 2019


To calculate the startup time for the JVM and JRuby combined, you can do
something like this:

➜  2019   time jruby -e 1
jruby -e 1  5.87s user 0.38s system 214% cpu 2.907 total

Using Tom's suggestion, it went down quite a bit:

➜  2019   time jruby --dev -e 1
jruby --dev -e 1  3.09s user 0.32s system 161% cpu 2.105 total

The 1 is just a simple expression for JRuby to evaluate.

- Keith

On Thu, Feb 21, 2019 at 2:47 AM Sean Felipe Wolfe <ether.joe at gmail.com>
wrote:

> Thanks Thomas I'll give it a try.
>
> Just found this page as well. Strenuous google search but worth it.
> https://github.com/jruby/jruby/wiki/Improving-startup-time
>
>
>
> On Wed, Feb 20, 2019 at 11:45 AM Thomas E Enebo <tom.enebo at gmail.com>
> wrote:
>
>> Have you tried --dev.  This could effect overal strainght-line
>> performance but it should reduce startup overhead as it disables tiered
>> compilation and tweaks a few other settings.
>>
>> -Tom
>>
>> On Wed, Feb 20, 2019 at 1:26 PM Sean Felipe Wolfe <ether.joe at gmail.com>
>> wrote:
>>
>>> Hello !
>>>
>>> I've got a side project using JRuby with the LibGDX game framework.
>>> Honestly it has been an awesome experience -- surprisingly stable, much
>>> more so than I expected.
>>>
>>> Right now there's a two second startup time and I'd like to reduce that.
>>> Can anybody suggest where I might start? Is it the size of the jarfiles for
>>> the game library? Is there a certain amount of overhead to starting the
>>> JRuby JVM? Are there ways to make that faster?
>>>
>>> If I can reduce this to sub 1 second, even half second, that would be
>>> interstellar!
>>>
>>> Thanks ~~
>>>
>>> --
>>> A musician must make music, an artist must paint, a poet must write, if
>>> he is to be ultimately at peace with himself.
>>> - Abraham Maslow
>>>
>>
>>
>> --
>> blog: http://blog.enebo.com       twitter: tom_enebo
>> mail: tom.enebo at gmail.com
>>
>
>
> --
> A musician must make music, an artist must paint, a poet must write, if he
> is to be ultimately at peace with himself.
> - Abraham Maslow
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ruby-lang.org/pipermail/jruby/attachments/20190221/a230c9fb/attachment.html>


More information about the JRuby mailing list