cucumber / cucumber-expressions

Human friendly alternative to Regular Expressions
MIT License
152 stars 51 forks source link

[Java] Improve expression creation performance #187

Closed jkronegg closed 1 year ago

jkronegg commented 1 year ago

🤔 What's changed?

Refactored ExpressionFactory to improve expression creation performance by about 50%.

⚡️ What's your motivation?

Fixes #185

🏷️ What kind of change is this?

♻️ Anything particular you want feedback on?

The PR has been asked by mpkorstanje

📋 Checklist:

aslakhellesoy commented 1 year ago

In order to keep the implementations consistent I think it would be a good idea to port this to the other implementations too.

mpkorstanje commented 1 year ago

@aslakhellesoy https://github.com/cucumber/cucumber-expressions/issues/190

jkronegg commented 1 year ago

I added cucumber-expressions 16.1.1 to my Maven dependencies (overrides the version 16.0.0 used in cucumber-core 7.9.0) and the profiler says it's 37% faster. 😁

fslev commented 1 year ago

Well done. I've ran my suite of ~1000 scenarios in dry-run mode and instead of 37s I've got 13s with the latest release. Almost 300% performance boost.

mpkorstanje commented 1 year ago

@jkronegg now available in Cucumber 7.10. Much appreciated!