« Return to Thread: Studying Rails startup time

Re: Studying Rails startup time

by Charles Oliver Nutter-2 :: Rate this Message:

Reply to Author | View in Thread

Charles Oliver Nutter wrote:

> Now that we've gotten JRuby's own startup time down pretty low, I
> thought I'd start examining the startup time of nontrivial real-world
> apps. The biggest one of those, obviously, is Rails.
>
> Rails 2.1 with Mongrel (in development mode) starts up in about 12
> seconds on my machine, using soylatte Java 6, on OS X 10.5, a Core Duo
> 2.16GHz processor, and 2GB of memory. C Ruby starts up in about 8
> seconds, so we're actually not so far off the mark here.
>
> I added a ParserStats MBean to explore whether parse time might be a
> problem. Of course without knowing MRI's parse time, it's hard to know
> if this is good or bad, but here's the stats I gathered:
>
> * A total of 5.512MB of source are parsed during Rails startup
> * Total parse time spent was around 3.08s
> * There were 503 parses due to file loads
> * There were 1943 parses due to evals

One more metric on parsing...

I pulled out the long benchmark from bench_eval and ran it with --manage
to compare the total time versus the parse time. The two runs of the
eval benchmark were 18.2s and 17.9s for a total of about 36.1s.
According to the ParserStats MBean, total parse time for the whole run
was 32.66s. So I think it's at least safe to say that almost all the
overhead of eval is parsing/ast construction.

- Charlie

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Studying Rails startup time