-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Core] Add faster UUID generator selectable through SPI #2703
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2703 +/- ##
============================================
+ Coverage 84.69% 84.98% +0.28%
- Complexity 2685 2723 +38
============================================
Files 323 330 +7
Lines 9456 9556 +100
Branches 899 916 +17
============================================
+ Hits 8009 8121 +112
+ Misses 1120 1111 -9
+ Partials 327 324 -3
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
How to solve the Semver build error? Should I just change the version to
Also I saw that the test coverage is not so good, I'll work on that... |
Incrementing the minor version should make the semver check pass. You can use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look at everything yet but these stood out immediately.
cucumber-core/src/main/java/io/cucumber/core/eventbus/FastUuidGenerator.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/eventbus/DefaultUuidGenerator.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/runtime/UuidGeneratorServiceLoader.java
Show resolved
Hide resolved
Incrementing to
As the |
We can consider them false positives. You can add it to the https://github.com/cucumber/cucumber-jvm/blob/main/.revapi/api-changes.json |
cucumber-core/src/main/java/io/cucumber/core/eventbus/FastUuidGenerator.java
Outdated
Show resolved
Hide resolved
bba7773
to
1e7777c
Compare
1e7777c
to
39e815d
Compare
@mpkorstanje I've finished the work I planned to do on this PR. Do you see anything to change ? p.s. : I added documentation on cucumber/docs#850 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed this from my phone. Looks good overal. A few nitpicks and some minor stuff. I didn't see anything major.
I also left a few items for myself, please leave those open.
cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/eventbus/UuidGenerator.java
Show resolved
Hide resolved
cucumber-core/src/test/java/io/cucumber/core/eventbus/IncrementingUuidGeneratorTest.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/test/java/io/cucumber/core/options/CommandlineOptionsParserTest.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/test/java/io/cucumber/core/runtime/UuidGeneratorServiceLoaderTest.md
Outdated
Show resolved
Hide resolved
cucumber-core/src/test/java/io/cucumber/core/runtime/ObjectFactoryServiceLoaderTest.md
Outdated
Show resolved
Hide resolved
|
||
@Override | ||
public UUID get() { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Write an issue with the considerations of using a null-safe API, returning null only on methods annotated with nullable. Specifically investigate automated checks.
…, corrected Java8 compilation issue
# Conflicts: # CHANGELOG.md # cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java # cucumber-core/src/main/java/io/cucumber/core/eventbus/RandomUuidGenerator.java # cucumber-core/src/main/java/io/cucumber/core/eventbus/UuidGenerator.java # cucumber-core/src/test/java/io/cucumber/core/eventbus/IncrementingUuidGeneratorTest.java # cucumber-core/src/test/java/io/cucumber/core/eventbus/RandomUuidGeneratorTest.java # cucumber-core/src/test/java/io/cucumber/core/options/NoUuidGenerator.java # cucumber-core/src/test/java/io/cucumber/core/runtime/UuidGeneratorServiceLoaderTest.java # cucumber-junit/src/main/java/io/cucumber/junit/NoUuidGenerator.java # cucumber-testng/src/main/java/io/cucumber/testng/NoUuidGenerator.java # pom.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'll take care of the last few comments and merge this tomorrow in all likelihood.
cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java
Outdated
Show resolved
Hide resolved
cucumber-core/src/main/java/io/cucumber/core/eventbus/IncrementingUuidGenerator.java
Outdated
Show resolved
Hide resolved
With #2703 a faster UUID generator was introduced. And while the configuration options were added, they were not actually used by `cucumber-junit`, `cucumber-junit-platform-engine` and `cucumber-testng`.
With #2703 a faster UUID generator was introduced. And while the configuration options were added, they were not actually used by `cucumber-junit`, `cucumber-junit-platform-engine` and `cucumber-testng`.
With #2703 a faster UUID generator was introduced. And while the configuration options were added, they were not actually used by `cucumber-junit`, `cucumber-junit-platform-engine` and `cucumber-testng`.
With #2703 a faster UUID generator was introduced. And while the configuration options were added, they were not actually used by `cucumber-junit`, `cucumber-junit-platform-engine` and `cucumber-testng`.
🤔 What's changed?
The cucumber event bus UUID generator can now be configured through a SPI using a properties from:
cucumber.properties
junit-platform.properties
@CucumberOptions
Two UUID generators are provided:
An event has a UUID. The UUID generator can be configured using the
cucumber.uuid-generator
property:Performance on real projects depends on the size (e.g. on a project with 3095 Given, 445 When, 1177 Then, 445 Scenarios, 48 Rules, the
IncrementingUuidGenerator
improves the global performance by about 3-5% and the feature file parsing performance of about 37%).The
IncrementingUuidGenerator
is a very simple UUID generator based onAtomicLong
counters. It is thread-safe and collision-free within a single JVM.The
RandomUuidGenerator
is a usualUUID.randomUUID()
generator.⚡️ What's your motivation?
Fixes #2698
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
Files of particular interest are:
IncrementingUuidGenerator
RandomUuidGenerator
README.md
UuidGeneratorServiceLoader
After this PR, I'll add a description on https://cucumber.io/docs/cucumber/state/?lang=java#the-cucumber-object-factory
📋 Checklist: