-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eskip: improve lexer performance (#2755)
* eskip: use larger predicate for BenchmarkParsePredicates Signed-off-by: Alexander Yastrebov <[email protected]> * eskip: optimize lexer performance * do not use fmt.Sprintf in ParseFilters and ParsePredicates * avoid allocations for fixed tokens * optimize scanWhile loop * add scanEscaped fast path * optimize scanRegexp and scanEscaped using strings.Builder * optimize scanWhitespace * optimize selectScanner using switch ``` goos: linux goarch: amd64 pkg: github.com/zalando/skipper/eskip cpu: Intel(R) Core(TM) i5-8350U CPU @ 1.70GHz │ HEAD~1 │ HEAD │ │ sec/op │ sec/op vs base │ ParsePredicates-8 29.88µ ± 3% 11.33µ ± 2% -62.09% (p=0.000 n=10) │ HEAD~1 │ HEAD │ │ B/op │ B/op vs base │ ParsePredicates-8 4.863Ki ± 0% 2.008Ki ± 0% -58.71% (p=0.000 n=10) │ HEAD~1 │ HEAD │ │ allocs/op │ allocs/op vs base │ ParsePredicates-8 198.00 ± 0% 33.00 ± 0% -83.33% (p=0.000 n=10) ``` Signed-off-by: Alexander Yastrebov <[email protected]> --------- Signed-off-by: Alexander Yastrebov <[email protected]>
- Loading branch information
1 parent
e44f2b8
commit d468a59
Showing
3 changed files
with
150 additions
and
162 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.