Speed up feature_management_spec.rb by removing use of browser#7005
Speed up feature_management_spec.rb by removing use of browser#7005zachmargolis merged 2 commits intomainfrom
Conversation
[skip changelog]
| "spec/presenters/setup_presenter_spec.rb": 0.05804999999963911, | ||
| "spec/features/remember_device/session_expiration_spec.rb": 5.3716609999974025, | ||
| "spec/requests/redirects_spec.rb": 0.12476699999388075, | ||
| "spec/lib/feature_management_spec.rb": 158.021550999998, |
There was a problem hiding this comment.
I couldn't figure out how to regenerate the weight for this... so figured it was just easier to remove 😬
There was a problem hiding this comment.
KNAPSACK_GENERATE_REPORT=true rspec is the way I've done in the past, but that's for all tests, and it takes a very long time to run.
You could generate it for the one file and merge the resulting report into the original file, but I'm not sure if that weight would be accurate on its own without anything to compare it to (unsure if the number is an absolute weight or a relative weight, and unsure if it varies from computer to computer).
KNAPSACK_GENERATE_REPORT=true rspec spec/lib/feature_management_spec.rb
This is what I got when doing that:
| "spec/lib/feature_management_spec.rb": 158.021550999998, | |
| "spec/lib/feature_management_spec.rb": 0.27332799999567214, |
There was a problem hiding this comment.
Maybe I typo'd the env variable, but it didn't write that file for me. Anyways this is great, thanks!
And I'm almost certain the values in here are a number of seconds, so they're essentially absolute weights
There was a problem hiding this comment.
Maybe I typo'd the env variable, but it didn't write that file for me.
I was having a similar issue, and in my case it was the difference between using KNAPSACK_GENERATE_REPORT=1 and KNAPSACK_GENERATE_REPORT=true. Not sure if that helps in your case.
There was a problem hiding this comment.
And I'm almost certain the values in here are a number of seconds
Yep, it's seconds
aduth
left a comment
There was a problem hiding this comment.
Nice find! Was there a particular way you discovered this, or just stumbled across it? I'm curious now if there are others.
I sorted by the values in knapsack report, and looked for things outside of |
Co-authored-by: Andrew Duthie <aduth@users.noreply.github.com>
mitchellhenke
left a comment
There was a problem hiding this comment.
great find! 👏🏼 👏🏼 👏🏼 👏🏼
about a 200x speedup