shoes / shoes4

Shoes 4 : the next version of Shoes
Other
1.59k stars 194 forks source link

Improving startup time #186

Open PragTob opened 11 years ago

PragTob commented 11 years ago

Hi everyone,

shoes4 is a bit slow too start which is mostly due to jRuby (at least, I figure so), the good old Charles Nutter just tweeted a link to an article in the jRuby wiki which is all about improving startup time. Maybe it's worth looking into.

davorb commented 11 years ago

Maybe it's just me, but I feel like this has gotten a lot worse lately, so I suspect that it's more to do with our code than JRuby itself. It might be a good idea to have a look with the profiler and see where the problem is.

Anonyfox commented 11 years ago

@headius updated the section about tiered-compilation just after i asked him about startup-time problems.

-XX:+TieredCompilation -XX:TieredStopAtLevel=1

as flags to jruby reduced the time for require'ing gems by 50%, but didn't affect something else as far as i could see. My specific problem was exactly this: several seconds for startup just for some requires, and the tiered compilation flags reduced this and only this.

/agree with davorb, profiling would be reasonable.

hope this helps

wasnotrice commented 11 years ago

I tried some informal profiling of startup. It looks like almost all of our time is spent in require. The switches on the wiki page didn't seem to affect startup time for my jruby (I think they are enabled by default). However, when using bin/shoes we were spinning up jruby twice. That's a big hit. I converted bin/shoes to a shell script, and that seems to have cut startup time almost in half on my machine. Try it out :)

edit: this change is in #187

jrgifford commented 11 years ago

The pull request @wasnotrice submitted above seems to cut it in half for me as well (platform is ubuntu as usual).

davorb commented 11 years ago

The startup was roughly 30% faster with your changes. But it's still too slow. We should consider adding a splash screen if we can't get the startup time to be less than five seconds.

Here are my results: https://gist.github.com/4486023

However, I wouldn't put too much effort into optimizations before we've

gotten one of the pre-releases out of the door.

Davor Babic davor@davor.se

James Gifford wrote:

The pull request @wasnotrice https://github.com/wasnotrice submitted above seems to cut it in half for me as well (platform is ubuntu as usual).

— Reply to this email directly or view it on GitHub https://github.com/shoes/shoes4/issues/186#issuecomment-12007982.

wasnotrice commented 11 years ago

The startup was roughly 30% faster with your changes. But it's still too slow. We should consider adding a splash screen if we can't get the startup time to be less than five seconds.

Absolutely. This is just some low-hanging fruit :)

PragTob commented 11 years ago

I like low hanging fruits :-)

PragTob commented 11 years ago

Okay merged, thanks!

I'd be pro for keeping this issue open though since most likely, we can still make improvements! :-)

jrgifford commented 11 years ago

Blech. Splashscreens. If we're going to design and implement a splash screen, we should seriously reconsider life.

we should spend the time on making it faster, instead. Or am I just being a young idealistic fool? :grinning: