Skip to content

rm regexp use#48169

Merged
vvoland merged 3 commits intomoby:masterfrom
kolyshkin:layer-regexp
Jul 17, 2024
Merged

rm regexp use#48169
vvoland merged 3 commits intomoby:masterfrom
kolyshkin:layer-regexp

Conversation

@kolyshkin
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin commented Jul 16, 2024

- What I did

Replaced the regexp checking ID validity with a function. The benefits are:

  • function is faster (up to 10x faster with less allocations);
  • no init overhead to compile the regexp.

- How I did it

- How to verify it

Test case is added (for the first commit only, others are identical).

Replace the regexp checking ID validity with a function. The benefits
are:

 - function is faster (up to 10x faster with less allocations);
 - no init overhead to compile the regexp;

Add a test case.

Signed-off-by: Kir Kolyshkin <[email protected]>
Replace the regexp checking ID validity with a for loop.

The benefits are:
 - faster (up to 10x faster with less allocations);
 - no init overhead to compile the regexp.

Signed-off-by: Kir Kolyshkin <[email protected]>
Replace the regexp check with a function.

Keep the use of regexp.QuoteMeta.

Signed-off-by: Kir Kolyshkin <[email protected]>
@kolyshkin kolyshkin changed the title layer: rm regexp use rm regexp use Jul 16, 2024
@thaJeztah thaJeztah added status/2-code-review kind/refactor PR's that refactor, or clean-up code labels Jul 16, 2024
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

LGTM

@thaJeztah thaJeztah added this to the 28.0.0 milestone Jul 16, 2024
@vvoland vvoland merged commit 3a62d49 into moby:master Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants