Fix PathPatternNode wildcard cache lifecycle - #18672
Merged
jt2594838 merged 1 commit intoSep 21, 2026
Merged
Conversation
jt2594838
approved these changes
Sep 21, 2026
3 tasks
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.
Description
PathPatternNodeused to retain non-trivial wildcard child names and compile a regular expression on every match. This change caches the compiledPatternobjects instead.getMatchChildren.PathPatternUtil.isNodeMatch.Testing
Result:
BUILD SUCCESS; 2 tests passed. Checkstyle and Spotless checks passed.This PR has:
Key changed/added classes
PathPatternNodePathPatternUtilPathPatternNodeTestLocal benchmark results
The follow-up benchmark from #18685 was run against the cached implementation from merge commit
9be80ead1dcand an in-test reproduction of the pre-change compile-on-every-match path. Environment: Windows 11 (build 26200), JDK 17.0.15, Intel Core i9-13900H, 2026-09-21. Each result is the median over 7 rounds after 2,000 warmup lookups; each round performed 20,000 lookups over 1,000 distinct queries.mvn -pl iotdb-core/node-commons -Dtest=PathPatternNodePerformanceTest -Diotdb.path.pattern.node.perf.enabled=true -Diotdb.path.pattern.node.perf.wildcard-counts=1,10,100 -Diotdb.path.pattern.node.perf.query-count=1000 -Diotdb.path.pattern.node.perf.warmup-lookups=2000 -Diotdb.path.pattern.node.perf.lookups=20000 -Diotdb.path.pattern.node.perf.rounds=7 testThe pre-change column is deliberately implemented inside the benchmark for an apples-to-apples comparison; it is not a separately built old binary. The cached implementation is about 5-6x faster in this workload, with 80-83% lower lookup latency. The targeted Maven run passed (1 test, 0 failures; Checkstyle, Spotless, compilation, and Surefire all passed).