Repository navigation
Conversation
mcculls
marked this pull request as ready for review
October 17, 2026 18:38
mcculls
force-pushed
the
mcculls/internal-names-collisions
branch
10 times, most recently
from
October 18, 2026 16:09
534d5d2 to
110868d
Compare
This comment has been minimized.
This comment has been minimized.
mcculls
force-pushed
the
mcculls/internal-names-collisions
branch
3 times, most recently
from
October 18, 2026 18:21
532c53d to
9869a4e
Compare
Replaces bounded rehashing and repeated table growth with a fixed table sized to at most 50% load. Resolves collisions by linear probing and keeps hashes in a parallel array to avoid accessing strings whose hashes differ. Collisions, wraparound, normalized duplicates, and allocation-free CharSequence lookups are checked in InternalNamesTest. Moves the class-name corpus into testing and exposes it through SampleClasses.loadClassNames(). Updates the utils benchmarks to use the shared resource, and adds an InternalNames benchmark matching all 33,957 corpus names against 25 groups sampled from dd-trace-java, using both String and TypeString queries. The benchmark checks every corpus class against every sampled group and reports time per class. It normalizes names and precompute hashes outside measurement, validates membership against HashSet during setup, and returns the total match count to keep all lookups observable.
mcculls
force-pushed
the
mcculls/internal-names-collisions
branch
from
October 18, 2026 18:28
9869a4e to
b9370e6
Compare
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
Replace bounded rehashing and repeated table growth in
InternalNameswith a fixed table sized to at most 50% load. Resolve collisions with linear probing and cache hashes in a parallel array so lookups skip strings whose hashes differ. Names are normalized and deduplicated during construction, and lookups continue to support allocation-free queries usingStringor anyCharSequencewith a String-compatible hash code.Motivation
Distinct names with identical String hashes follow the same probe sequence. Repeatedly growing the table cannot resolve those collisions and can exhaust the heap. Linear probing handles these collisions without rebuilding or growing the table.
Additional Notes
CharSequencequeries, matcher factory integration, and set behavior.testing, expose it throughSampleClasses.loadClassNames(), and update the utils benchmarks to use it.InternalNamesbenchmark that checks all 33,957 corpus names against 25 groups sampled from dd-trace-java with bothStringandTypeStringqueries. It reports time per corpus class across all groups, normalizes names and precomputes query hashes outside measurement, validates membership againstHashSetduring setup, and returns the total match count to keep all lookups observable.Contributor Checklist
class-matchtests passed on JDK 8, 11, 17, 21, and 25.class-matchformatting checks passed.