java: Use a generated keyword matcher to improve performance#445
Merged
mpkorstanje merged 15 commits intomainfrom Jul 30, 2025
Merged
java: Use a generated keyword matcher to improve performance#445mpkorstanje merged 15 commits intomainfrom
mpkorstanje merged 15 commits intomainfrom
Conversation
mpkorstanje
added a commit
that referenced
this pull request
Jul 30, 2025
Aside from being good practice, extensibility if not designed for should be prohibited, this will help isolate some of the effects of #445.
mpkorstanje
added a commit
that referenced
this pull request
Jul 30, 2025
Aside from being good practice, extensibility if not designed for should be prohibited, this will help isolate some of the effects of #445.
71452c8 to
3551231
Compare
jkronegg
approved these changes
Jul 30, 2025
Contributor
jkronegg
left a comment
There was a problem hiding this comment.
Nice job! The generated code looks good and the give confidence on the loop unrolling.
On my realworld project with 740 BDD scenarios, the GherkinMessagesFeatureParser.parse is 25% faster than with the main branch (100 ms -> 75 ms).
jkronegg
reviewed
Jul 30, 2025
7 tasks
Contributor
Author
That is incredible. If you have more ideas I'd be happy to see them. 👍 |
7 tasks
7 tasks
This was referenced Aug 18, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤔 What's changed?
Improve performance by matching step and title keywords using a generated matcher class.
Before
main@ b3413a9After
⚡️ What's your motivation?
In #443 @jkronegg shows that unrolling the loops over the keywords speeds gherkin parsing significantly. I'm not sure about the theoretical underpinnings but the effect is there. This refines that solution by making the unrolling work for an arbitrary number of keywords in each language.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
📋 Checklist: