UrlPatternIndex: Lazily compute rule count for UrlPatternIndexMatcher.
IndexedRuleset.median_match_time_avg/MatchAll perftest shows a regression after r759462 due to computation of rule count in the UrlPatternIndexMatcher constructor. This CL changes UrlPatternIndexMatcher rule count to be lazily computed which should ensure that the cost of computation is only paid by clients which use the rule count. When the perf test is run locally on my machine: Without this CL: *RESULT IndexedRuleset.median_match_time: MatchAll= 231364 us With this CL: *RESULT IndexedRuleset.median_match_time: MatchAll= 80248 us Note that the test regression is exaggerated since the test creates a UrlPatternIndexMatcher for each request. BUG=1071599 Change-Id: I6364e4b9043494d18389a41c517b90756ba4c8f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153693 Commit-Queue: Karan Bhatia <karandeepb@chromium.org> Auto-Submit: Karan Bhatia <karandeepb@chromium.org> Reviewed-by:Charlie Harrison <csharrison@chromium.org> Cr-Commit-Position: refs/heads/master@{#759905}
Showing
Please register or sign in to comment