Skip to content

Draft: Improve group_service_spec performance

Dmitry Gruzd requested to merge improve-group-service-spec into master

What does this MR do and why?

This MR decreases the number of allocations for ee/spec/services/search/group_service_spec.rb and adds optional argument to ensure_elasticsearch_index!

Screenshots or screen recordings

Before:

FPROF=1 bin/rspec ee/spec/services/search/group_service_spec.rb:22
...
[TEST PROF INFO] Time spent in factories: 00:02.505 (13.16% of total time)
[TEST PROF INFO] Factories usage

 Total: 41
 Total top-level: 17
 Total time: 00:02.505 (out of 00:19.586)
 Total uniq factories: 7

After:

❯ FPROF=1 bin/rspec ee/spec/services/search/group_service_spec.rb:22
...
[TEST PROF INFO] Time spent in factories: 00:01.227 (7.17% of total time)
[TEST PROF INFO] Factories usage

 Total: 23
 Total top-level: 10
 Total time: 00:01.227 (out of 00:17.538)
 Total uniq factories: 7

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Dmitry Gruzd

Merge request reports