Refactored quick action processing to remove multiple gsub calls
What does this MR do?
The Gitlab::QuickActions::Extractor
was too heavy weight. There was a gsub
over all the content to replace/extract commands. Then there was a gsub
for each substitution, which there are currently two.
I was able to combine them into just one gsub
call.
Related to #217483 (closed)
Benchmarks
Using the test data from the issue, locally.
Before the refactor:
=> #<Benchmark::Tms:0x00007fda9a196d98
@cstime=0.0,
@cutime=0.0,
@label="",
@real=101.43374899995979,
@stime=0.8151200000000003,
@total=100.03441899999999,
@utime=99.21929899999999>
after the refactor
=> #<Benchmark::Tms:0x00007fd4b654c058
@cstime=0.0,
@cutime=0.0,
@label="",
@real=32.23766800004523,
@stime=0.13787299999999902,
@total=32.04911,
@utime=31.911237>
Screenshots
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 Brett Walker