Repository navigation
Make IsTrivial() constant time - #1605
Merged
Merged
Conversation
This is mathematically equivalent, and makes list-unicodeset.jsp result for `[:L:]` 39x faster, changing from 16s to 0.4s on my local benchmark. It also vastly reduces temporary memory allocations.
3 tasks
eggrobin
approved these changes
Oct 13, 2026
Contributor
Author
|
@eggrobin, here's an analysis of why
The two calls came from these conditions: if ((property == null && TOOL_ONLY_PROPERTIES.contains(xPropertyName))
|| (property != null && property.isTrivial() && allowRetroactive)) {
...
}
if (property == null || property.isTrivial()) {
...
}The first condition evaluated For the benchmark’s 158,172 letters, the grouping loop alone therefore caused:
Fetching character names added another path: |
roozbehp
added a commit
that referenced
this pull request
Oct 13, 2026
) Also: - Resolve development properties only if showDevProperties is true - Check allowRetroactive before calling property.isTrivial() in VersionedProperty.java This further improves the speed of list-unicodeset.jsp resolution for [:L:] by 4x on top of #1605. Without #1605 applied, it improves the speed of the above resolution by 6x. It also reduces temporary memory allocations by about 90%.
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.
This is mathematically equivalent, and makes list-unicodeset.jsp result for
[:L:]39x faster, changing from 16s to 0.4s on my local benchmark. It also vastly reduces temporary memory allocations.