stats: find regex prefixes more aggressively, taking into account ignored dot token#2630
Conversation
Signed-off-by: Joshua Marantz <jmarantz@google.com>
This reverts commit 661911a. Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
any chances someone could take a quick look? This has a very large speedup-to-lines-changed ratio |
source/common/stats/stats_impl.cc
Outdated
| : name_(name), prefix_(std::string(extractRegexPrefix(regex))), | ||
| regex_(RegexUtil::parseRegex(regex)) {} | ||
|
|
||
| static bool regexStartsWithDot(absl::string_view regex) { |
There was a problem hiding this comment.
Nit: can you move this to anonymous namespace to match general Envoy style for .cc local definitions?
There was a problem hiding this comment.
I made that exact comment on @gsagula 's gzip filter review and @dnoe commented on my comment:
"I think in most cases of Envoy code base you will see static methods rather than the anonymous namespaces style (I told @gsagula to use the static method style based on that), although there's plenty of anonymous namespace style too. The google style guide is ambivalent about this. Let's standardize on one or the other and codify it in STYLE.md."
Shame on me for not following up. On this particular topic I actually truly don't care -- static vs anon-namespace. Can the two of you decide and I'll write the PR to put it in STYLE.md and (if needed) fix this instance accordingly?
There was a problem hiding this comment.
I vote for anonymous namespaces as the standard.
…uire that generally. Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
Signed-off-by: Joshua Marantz <jmarantz@google.com>
|
I think all comments are addressed; PTAL. |
* update common file, including lcense * update makefile override
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Signed-off-by: JP Simard <jp@jpsim.com>
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Signed-off-by: JP Simard <jp@jpsim.com>
Description:
This PR expands the scope of regexes where we can parse out a prefix. This has a dramatic effect on the annotated perf information available with #2615 patched in
Before:
After:
Note that many fewer regexes need to be evaluated, although the really expensive ones are still examined very often. They need to be evaluated less often or made to be cheaper, preferably both.
Risk Level: Low
Release Notes: N/A