-
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: separate parsing of predicates and filters (#2873)
Introduce start tokens to allow separate parsing of eskip document, predicates and filters, see https://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html Also remove `stringval` and `regexpval` rules. These rules are aliases for `stringliteral` which can be used directly. This reduces parser stack depth and item size. The change fixes parse error position value and speeds up predicates/filters parsing. ``` 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 8.531µ ± 2% 7.464µ ± 5% -12.51% (p=0.000 n=10) Parse-8 257.3m ± 1% 251.4m ± 2% -2.32% (p=0.000 n=10) geomean 1.482m 1.370m -7.55% │ HEAD~1 │ HEAD │ │ B/op │ B/op vs base │ ParsePredicates-8 2.375Ki ± 0% 1.773Ki ± 0% -25.33% (p=0.000 n=10) Parse-8 61.79Mi ± 0% 61.79Mi ± 0% ~ (p=0.698 n=10) geomean 387.7Ki 335.0Ki -13.59% │ HEAD~1 │ HEAD │ │ allocs/op │ allocs/op vs base │ ParsePredicates-8 53.00 ± 0% 50.00 ± 0% -5.66% (p=0.000 n=10) Parse-8 1.510M ± 0% 1.510M ± 0% ~ (p=0.700 n=10) geomean 8.946k 8.689k -2.87% │ HEAD~1 │ HEAD │ │ bytes/op │ bytes/op vs base │ Parse-8 15.99Mi ± 0% 15.99Mi ± 0% ~ (p=1.000 n=10) ¹ ¹ all samples are equal ``` Signed-off-by: Alexander Yastrebov <[email protected]>
- Loading branch information
1 parent
cbc4e2d
commit f35824c
Showing
10 changed files
with
256 additions
and
150 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
2 changes: 1 addition & 1 deletion
2
dataclients/kubernetes/testdata/routegroups/convert/failing-filter.log
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
\[routegroup\] parse failed after token foo, position 8: syntax error | ||
\[routegroup\] parse failed after token foo, position 3: syntax error |
2 changes: 1 addition & 1 deletion
2
dataclients/kubernetes/testdata/routegroups/convert/no-catchall-for-failed-route-group.log
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
\[routegroup\] parse failed after token foo, position 8: syntax error | ||
\[routegroup\] parse failed after token foo, position 3: syntax error |
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
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.