Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Performance fix for MRI 1.9 #1288

Merged
merged 1 commit into from
Jul 17, 2011
Merged

Conversation

zeha
Copy link
Contributor

@zeha zeha commented Jul 6, 2011

I did some testing to cut time for bundle install runs, and this is one of the low hanging fruits fur Ruby 1.9.

Commit text:
MRI 1.9 is considerably faster when directly comparing Gem::Version,
while 1.8 is faster with the regex method.

Tested with:
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]
Rubygems 1.8.5

Test program: https://gist.github.com/1067157

Timings:
1.9 without the change: ~12 sec
1.9 with the change: ~6 sec
1.8 always: ~19 sec

MRI 1.9 is considerably faster when directly comparing Gem::Version,
while 1.8 is faster with the regex method.
@sferik
Copy link
Member

sferik commented Jul 8, 2011

👍 Looks good to me!

@masterkain
Copy link

+1!

sferik added a commit that referenced this pull request Jul 17, 2011
@sferik sferik merged commit 54cb582 into rubygems:1-0-stable Jul 17, 2011
indirect added a commit that referenced this pull request Aug 9, 2011
---
Make fetch_specs faster

fetch_specs merges installed, cached and remote_specs together, using Index.use.
Index.use has acceptable performance for small indexes, but when adding a large Index as generated by remote_specs, it takes ages.

This change reorders fetch_specs to base its index off of the index generated by remote_specs and then replaces dupes with what cached_specs and installed_specs come up with.

Measured timing approximates, with this test program: https://gist.github.com/1067157

MRI 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]

    1-0-stable       17sec
    + this            9sec
    + this + #1288    9sec

MRI 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]

    1-0-stable       11sec
    + this            6sec
    + this + #1288    4sec
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants