-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Spec speed ups on AccountsController
spec
#25391
Merged
ClearlyClaire
merged 15 commits into
mastodon:main
from
mjankowski:spec-performance-controller-accounts
Oct 17, 2023
Merged
Spec speed ups on AccountsController
spec
#25391
ClearlyClaire
merged 15 commits into
mastodon:main
from
mjankowski:spec-performance-controller-accounts
Oct 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
renchap
added
testing
Automated lint and test suites
ruby
Pull requests that update Ruby code
labels
Jun 13, 2023
mjankowski
force-pushed
the
spec-performance-controller-accounts
branch
from
June 13, 2023 13:08
8e42f70
to
77327c2
Compare
mjankowski
changed the title
Spec speed ups on accounts controller spec
Spec speed ups on Jun 22, 2023
AccountsController
spec
This pull request has merge conflicts that must be resolved before it can be merged. |
mjankowski
force-pushed
the
spec-performance-controller-accounts
branch
from
October 16, 2023 16:51
77327c2
to
5fc5ff9
Compare
This pull request has resolved merge conflicts and is ready for review. |
ClearlyClaire
approved these changes
Oct 17, 2023
audiodude
pushed a commit
to audiodude/mastodon
that referenced
this pull request
Oct 23, 2023
000hen
pushed a commit
to thenapnetwork/nap-mastodon
that referenced
this pull request
Dec 6, 2023
vmstan
pushed a commit
to vmstan/mastodon
that referenced
this pull request
Dec 14, 2023
vmstan
pushed a commit
to vmstan/mastodon
that referenced
this pull request
Jan 5, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As noted towards the end of #25369 (comment) - when I was working on the various Sidekiq/Fabricate/Paperclip spec speedup PRs, another pattern I noticed was lots of spec files where we have a (moderately expensive) setup step happening in a
before
block which is getting run for every example in it's context.This is sometimes fine if the setup is trivial and the examples are complex and would become severely unreadable by combining them, but in other areas there's an expensive setup and the examples are all checking against the same result ... and because of the
before
running for each one it's expensive to do.Before doing a widescale change like this on the whole suite, I wanted to open this as an example of what I'm thinking. I tried to pick a spec which was repetitive enough that I guessed there might be speedups, but simple enough that it wouldn't be overwhelming to change/review.
The diff here is pretty noisy and it will almost definitely be easier to understand the changes by stepping through one commit at a time - I think they are pretty atomic/descriptive on their own.
All that said, the changes here:
Before changes this spec was taking ~23 seconds to run locally. After changes it takes ~11s locally. I have no idea if this magnitude of change is higher/lower/normal etc for this one file vs the whole rest of the spec.
Would love feedback here before I do more of this on other specs.