metricwriter: compile regular expressions only on first use#2641
Merged
Conversation
Compile the regular expressions only on first use rather than implicitly as part of the `init()` function of the package. This prevents taking a speed hit on the initialization of the package regardless if this type is used and moves it to the time when a regular expression is first used. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
jsternberg
force-pushed
the
metricwriter-lazy-regexp
branch
from
August 5, 2024 15:23
b93fdd2 to
2810f20
Compare
Member
|
I assume this fixes #2596? |
Collaborator
Author
|
Yes. I've updated the PR description to reference that issue. |
crazy-max
approved these changes
Aug 6, 2024
Member
|
The It's not a high priority to update this but I guess we should leave the issue open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Compile the regular expressions only on first use rather than implicitly as part of the
init()function of the package. This prevents taking a speed hit on the initialization of the package regardless if this type is used and moves it to the time when a regular expression is first used.Fixes #2596.