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

Already on GitHub? Sign in to your account

Add simple cache to Bundler.load_gemspec #1635

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Contributor

dekellum commented Jan 19, 2012

In some projects, for example those with 10s of local gemspecs, use of git ls-files for spec.files, or specs requiring significant source to get at a spec.version; this change to cache load_gemspec results in notable performance gains.

The cache also avoids loading these same gemspecs repeatedly with different LOAD_PATH values.

This came up originally in #1481 (\cc @sunaku, @tenderlove). Only a sub-case (specs from rubygems) of that original issue was dealt with before it was closed (#1567). There also, @indirect suggests "[caching] seems like a good plan eventually"

Perhaps this is actually easy enough, safe enough (I find no spec regressions) and suitable for 1.1?

Add simple cache to Bundler.load_gemspec
In some projects, for example those with 10s of local gemspecs, use of
`git ls-files` for spec.files, or specs requiring significant source
to get at a spec.version; this change to cache load_gemspec results in
notable performance gains.

The cache also avoids loading these same gemspecs repeatedly with
different LOAD_PATH values.
Owner

indirect commented Jan 19, 2012

This seems like a good idea to me. I'm wary of potentially introducing issues late in the 1.1 release cycle, but hopeful that we can squeeze this in to the next RC.

Contributor

sunaku commented Jan 20, 2012

+1

Contributor

dekellum commented Jan 21, 2012

Fair enough regarding 1.1 release cycle. Would master be the next development branch? Would it be reasonable to merge and vet this change there?

Owner

indirect commented Jan 21, 2012

I've merged this to master as 051c7a921de855139b3779cec1e5fdb7542b417c. Thanks for the patch!

@indirect indirect closed this Jan 21, 2012

Contributor

dekellum commented Jan 24, 2012

@indirect Thanks! When you going to push this commit?

Contributor

dekellum commented Jan 27, 2012

Hey @indirect, sorry to be a bother, but did this merge commit get lost in the shuffle?

Owner

indirect commented Jan 27, 2012

Oops! Not sure how I missed pushing before. Thanks for reminding me about this. I've pushed your patch to the tip of master now, as 3d4163a.

Contributor

dekellum commented Mar 27, 2012

And reverted in 6b45e28. *sigh* Will try to bring it back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment