Speed up API GraphQL specs for Merge Requests
What does this MR do?
This MR speeds up API GraphQL specs for Merge Requests.
Here's the output from test-prof
when run with FPROF=1
. Note:
-
Finished in
improved by ~60 seconds🚀 -
Total
amount of factories created went down from 1012 to 517🚀
Before
Finished in 2 minutes 32.2 seconds (files took 1.79 seconds to load)
505 examples, 0 failures
Randomized with seed 16771
[TEST PROF INFO] Factories usage
Total: 1012
Total top-level: 1009
Total time: 67.6883s
Total uniq factories: 8
total top-level total time top-level time name
505 505 6.9500s 6.9500s personal_access_token
498 498 58.6791s 58.6791s merge_request
2 1 0.5609s 0.4016s project
2 0 0.1050s 0.0000s namespace
2 2 1.2942s 1.2942s labeled_merge_request
1 1 0.0075s 0.0075s license
1 1 0.1384s 0.1384s user
1 1 0.2175s 0.2175s label
After
Finished in 1 minute 26.33 seconds (files took 1.79 seconds to load)
505 examples, 0 failures
Randomized with seed 26268
[TEST PROF INFO] Factories usage
Total: 517
Total top-level: 514
Total time: 8.4844s
Total uniq factories: 8
total top-level total time top-level time name
505 505 6.2635s 6.2635s personal_access_token
3 3 0.1874s 0.1874s merge_request
2 1 0.5962s 0.4419s project
2 0 0.1112s 0.0000s namespace
2 2 1.2645s 1.2645s labeled_merge_request
1 1 0.0069s 0.0069s license
1 1 0.1308s 0.1308s user
1 1 0.1894s 0.1894s label
Somehow related to #213649 (closed)
Does this MR meet the acceptance criteria?
Conformity
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
- [-] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [-] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [-] Security reports checked/validated by a reviewer from the AppSec team
Edited by Peter Leitzen