Skip to content

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