perf(specs): Clean up factories usage in spec/specs in directories k-o - #6250
Open
vankiru wants to merge 5 commits into
Open
perf(specs): Clean up factories usage in spec/specs in directories k-o#6250vankiru wants to merge 5 commits into
vankiru wants to merge 5 commits into
Conversation
vankiru
force-pushed
the
perf/spec-services-k-o
branch
from
August 31, 2026 09:02
fb326b3 to
a294733
Compare
vankiru
marked this pull request as ready for review
August 31, 2026 15:27
Contributor
|
Automated pre-review (advisory, not a required check) — verdict: HOLD · CI green HOLD — several new
|
This file contains hidden or 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
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.
Context
Currently, around 50% of the spec runtime is spent preparing data and creating factories. A lot of this data is either duplicated or recreates the same objects multiple times, so we can get rid of a good chunk of it and significantly speed up the specs.
To avoid creating unnecessary factories, we can use
let_it_be,before_all, andcreate_defaultfromtest-prof. More info here.Description
This PR cleans up the services specs in folders
k-oand removes unnecessary factory usage.Here are the numbers before and after the cleanup. The times below are for running the specs in a single process:
Overall results
This PR is part of a series of PRs focused on cleaning up factory usage across different specs.
Once all the changes are merged, we expect to:
Here is the CI run with all the changes merged together: