-
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
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 │ master │ HEAD │ │ sec/op │ sec/op vs base │ ParsePredicates-8 7.626µ ± 2% 6.491µ ± 2% -14.88% (p=0.000 n=10) Parse-8 237.7m ± 1% 229.7m ± 2% -3.36% (p=0.000 n=10) geomean 1.346m 1.221m -9.30% │ master │ HEAD │ │ B/op │ B/op vs base │ ParsePredicates-8 1.961Ki ± 0% 1.359Ki ± 0% -30.68% (p=0.000 n=10) Parse-8 49.02Mi ± 0% 49.02Mi ± 0% ~ (p=0.529 n=10) geomean 313.7Ki 261.2Ki -16.74% │ master │ HEAD │ │ allocs/op │ allocs/op vs base │ ParsePredicates-8 32.00 ± 0% 29.00 ± 0% -9.38% (p=0.000 n=10) Parse-8 1.080M ± 0% 1.080M ± 0% ~ (p=0.777 n=10) geomean 5.879k 5.596k -4.80% │ master │ 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
5c1a94f
commit 82fb4b7
Showing
9 changed files
with
250 additions
and
149 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
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.