Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Fix issue causing our spec suite to run much slower. #2318

Merged
merged 1 commit into from
Aug 25, 2016

Conversation

myronmarston
Copy link
Member

Before this change:

$ bin/rspec | egrep 'Finished|(examples.*failure)'
Finished in 45.99 seconds (files took 0.89765 seconds to load)
2014 examples, 4 failures, 1 pending

After this change:

$ bin/rspec | egrep 'Finished|(examples.*failure)'
Finished in 11.16 seconds (files took 1.16 seconds to load)
2014 examples, 4 failures, 1 pending

I believe the issue was requiring 'rspec/rails/version'. Since
rspec-rails is not available, rubygems would exhaustively search
all my installed gems before raising LoadError. I have ~300 gems
installed and this was quite slow.

It's better to just force it to raise LoadError and not wait on
RubyGems to do the same thing.

Before this change:

$ bin/rspec | egrep 'Finished|(examples.*failure)'
Finished in 45.99 seconds (files took 0.89765 seconds to load)
2014 examples, 4 failures, 1 pending

After this change:

$ bin/rspec | egrep 'Finished|(examples.*failure)'
Finished in 11.16 seconds (files took 1.16 seconds to load)
2014 examples, 4 failures, 1 pending

I believe the issue was requiring 'rspec/rails/version'. Since
rspec-rails is not available, rubygems would exhaustively search
all my installed gems before raising `LoadError`. I have ~300 gems
installed and this was quite slow.

It's better to just force it to raise `LoadError` and not wait on
RubyGems to do the same thing.
@JonRowe
Copy link
Member

JonRowe commented Aug 25, 2016

LGTM

@JonRowe JonRowe merged commit 2a6bff1 into master Aug 25, 2016
@JonRowe JonRowe deleted the myron/address-slowness branch August 25, 2016 22:54
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
Fix issue causing our spec suite to run much slower.
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.

2 participants