Repository navigation
Conversation
This branch has not been deployed
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 Does This Do
Make
ClassNameFilter.containscompare the same truncated character and length values thataddstores. Names such asexample.例and simple names longer than 256 characters can now match immediately after insertion.Motivation
Insertion packs the first and last characters and the simple-name length into eight bits each, but lookup previously compared them against full values. This caused avoidable misses for Unicode and long simple names.
Additional Notes
The length mask retains the sign bit to reject a stored start position beyond the queried name's end. Both character mismatches are combined with XOR/OR before masking, reducing the overhead of separate comparisons. Regression tests cover Unicode names, length boundaries, and a shorter hash collision that would otherwise cause an out-of-bounds read.
Validation:
./gradlew :utils:check --no-configuration-cachepassed, including formatting, SpotBugs, and tests on Java 8, 11, 17, 21, and 25.The existing single-threaded benchmark at 65,536 slots measured 242.75 us per corpus pass on main and 243.37 us with this fix. Six balanced comparison rounds on Java 17/ARM64, with 5 seconds of warmup and 10 seconds of measurement per fork, gave a paired difference of +0.25% (95% confidence interval: -0.68% to +1.19%).
Contributor Checklist