Skip to content

Refactored quick action processing to remove multiple gsub calls

Brett Walker requested to merge bw-large-description-timeout into master

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

Availability and Testing

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

Merge request reports