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
speed up fixtures by not loading all their classes #17014
Conversation
Does it require any adicional step from people that already use |
if autoload works: no |
I don't like this:
People will not know why their tests are failing after this change. |
people that disabled autoload that is ... so not sure how many % that is On Mon, Sep 22, 2014 at 1:31 PM, Rafael Mendonça França <
|
@@ -870,34 +870,9 @@ def fixtures(*fixture_set_names) | |||
end | |||
|
|||
self.fixture_table_names |= fixture_set_names | |||
require_fixture_classes(fixture_set_names, self.config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 We already look up model classes by constantizing anyway.
As far as I can tell, requiring them here predates that, so we're doing duplicate work now.
FYI monkeypatch in case you want to try it out:
|
@rafaelfranca as @jeremy points out, the autoload will get fired anyhow since we do a constant lookup, so this code just seems like extra work. |
9804c28
to
336783a
Compare
fixed the tests, good to merge ? |
@tenderlove / @jeremy merge ? |
speed up fixtures by not loading all their classes
@grosser THANKS! <3<3<3<3 :-D |
this took our time for a test with
tixtures :all
from 28s to 20smost of the time, only the tables are needed and
fixtures :all
is just a developer saying "I don't know",so let's save the complexity and overhead!
people that rely on that can do their own requires or use eager loading in test.rb
@rafaelfranca @tenderlove