Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When finding ruby, skip loading rubygems for the speed #47

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

amatsuda
Copy link
Contributor

@amatsuda amatsuda commented Feb 2, 2018

Maybe this is yet another solution for #35.

Recent versions of ruby loads rubygems by default, which in some cases adds recognizable delay on simple ruby -e call, for instance when having thousands of gems installed in the system.

Here are results of time executing ruby -e with and without --disable-gems option on my machine (Ruby 2.5.0, Mac OSX).
Not very much significant, but still we can see a little bit of improvement.

% time ruby -e 42
ruby -e 42  0.08s user 0.04s system 85% cpu 0.138 total
% time ruby -e 42
ruby -e 42  0.08s user 0.03s system 94% cpu 0.118 total
% time ruby -e 42
ruby -e 42  0.07s user 0.03s system 83% cpu 0.124 total
% time ruby -e 42
ruby -e 42  0.07s user 0.04s system 94% cpu 0.112 total
% time ruby -e 42
ruby -e 42  0.07s user 0.03s system 93% cpu 0.109 total
% time ruby --disable-gems -e 42
ruby --disable-gems -e 42  0.03s user 0.03s system 80% cpu 0.075 total
% time ruby --disable-gems -e 42
ruby --disable-gems -e 42  0.03s user 0.03s system 92% cpu 0.066 total
% time ruby --disable-gems -e 42
ruby --disable-gems -e 42  0.03s user 0.03s system 92% cpu 0.067 total
% time ruby --disable-gems -e 42
ruby --disable-gems -e 42  0.03s user 0.03s system 81% cpu 0.071 total
% time ruby --disable-gems -e 42
ruby --disable-gems -e 42  0.03s user 0.03s system 92% cpu 0.067 total

@damphyr
Copy link
Collaborator

damphyr commented Feb 2, 2018

Looks good.
I'm going to run it on Windows as well, I expect there the difference to be even greater. Once I've done it I'll merge 👍

@damphyr damphyr mentioned this pull request Feb 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants