Superskyyy opened a new pull request, #11003: URL: https://github.com/apache/skywalking/pull/11003
Now this functionality is working well and can be seen in below screenshot. Showcase changes are pending next. One problem: I had to change this config to 4000 for UI to work, otherwise it complains query complexity too high.  Demo: (@wu-sheng btw, why are there two success rate metrics on this view?)  Changes: Optimize the splitByCharacter method by ignoring the first slash, also adds a heuristic to consider Length==1 slices to be a pattern itself, therefore always return a match. As a result trie structure is updated accordingly (basically removes the first layer which is almost always a slash), benchmark is update accordingly which shows the previous 40% perf gain is now more than 300%. <!-- 鈿狅笍 Please make sure to read this template first, pull requests that don't accord with this template maybe closed without notice. Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>. Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]` --> <!-- ==== 馃悰 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 馃憞 ==== ### Fix <bug description or the bug issue number or bug issue link> - [ ] Add a unit test to verify that the fix works. - [ ] Explain briefly why the bug exists and how to fix it. ==== 馃悰 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 馃憜 ==== --> ### Improve the performance of QuickMatch - [x] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java) - [x] The benchmark result. ```text * # JMH version: 1.25 * # VM version: JDK 16.0.1, OpenJDK 64-Bit Server VM, 16.0.1+9-24 * # VM invoker: C:\Users\Sky\.jdks\openjdk-16.0.1\bin\java.exe * # VM options: -ea --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED -Didea.test.cyclic.buffer.size=1048576 -javaagent:Y:\jetbrains\apps\IDEA-U\ch-0\231.8109.175\lib\idea_rt.jar=54938:Y:\jetbrains\apps\IDEA-U\ch-0\231.8109.175\bin -Dfile.encoding=UTF-8 -Xmx512m -Xms512m -XX:MaxDirectMemorySize=512m -XX:BiasedLockingStartupDelay=0 -Djmh.executor=CUSTOM -Djmh.executor.class=org.apache.skywalking.oap.server.microbench.base.AbstractMicrobenchmark$JmhThreadExecutor * # Warmup: 1 iterations, 10 s each * # Measurement: 1 iterations, 10 s each * # Timeout: 10 min per iteration * # Threads: 4 threads, will synchronize iterations * # Benchmark mode: Throughput, ops/time * # Benchmark: org.apache.skywalking.oap.server.microbench.core.config.group.uri.RegexVSQuickMatchBenchmark.notMatchRegex * Benchmark Mode Cnt Score Error Units * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping thrpt 48317763.786 ops/s * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.alloc.rate thrpt 8773.225 MB/sec * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.alloc.rate.norm thrpt 200.014 B/op * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.churn.G1_Eden_Space thrpt 8807.405 MB/sec * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.churn.G1_Eden_Space.norm thrpt 200.794 B/op * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.churn.G1_Survivor_Space thrpt 0.050 MB/sec * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.churn.G1_Survivor_Space.norm thrpt 0.001 B/op * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.count thrpt 303.000 counts * RegexVSQuickMatchBenchmark.matchFirstQuickUriGrouping:路gc.time thrpt 325.000 ms * RegexVSQuickMatchBenchmark.matchFirstRegex thrpt 41040542.288 ops/s * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.alloc.rate thrpt 8348.690 MB/sec * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.alloc.rate.norm thrpt 224.016 B/op * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.churn.G1_Eden_Space thrpt 8378.454 MB/sec * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.churn.G1_Eden_Space.norm thrpt 224.815 B/op * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.churn.G1_Survivor_Space thrpt 0.057 MB/sec * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.churn.G1_Survivor_Space.norm thrpt 0.002 B/op * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.count thrpt 288.000 counts * RegexVSQuickMatchBenchmark.matchFirstRegex:路gc.time thrpt 282.000 ms * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping thrpt 35658131.267 ops/s * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.alloc.rate thrpt 8020.546 MB/sec * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.alloc.rate.norm thrpt 248.018 B/op * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.churn.G1_Eden_Space thrpt 8043.279 MB/sec * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.churn.G1_Eden_Space.norm thrpt 248.721 B/op * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.churn.G1_Survivor_Space thrpt 0.045 MB/sec * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.churn.G1_Survivor_Space.norm thrpt 0.001 B/op * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.count thrpt 277.000 counts * RegexVSQuickMatchBenchmark.matchFourthQuickUriGrouping:路gc.time thrpt 302.000 ms * RegexVSQuickMatchBenchmark.matchFourthRegex thrpt 11066068.208 ops/s * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.alloc.rate thrpt 8273.312 MB/sec * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.alloc.rate.norm thrpt 824.060 B/op * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.churn.G1_Eden_Space thrpt 8279.984 MB/sec * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.churn.G1_Eden_Space.norm thrpt 824.724 B/op * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.churn.G1_Survivor_Space thrpt 0.052 MB/sec * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.churn.G1_Survivor_Space.norm thrpt 0.005 B/op * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.count thrpt 285.000 counts * RegexVSQuickMatchBenchmark.matchFourthRegex:路gc.time thrpt 324.000 ms * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping thrpt 45843193.472 ops/s * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.alloc.rate thrpt 8653.215 MB/sec * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.alloc.rate.norm thrpt 208.015 B/op * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.churn.G1_Eden_Space thrpt 8652.365 MB/sec * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.churn.G1_Eden_Space.norm thrpt 207.995 B/op * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.churn.G1_Survivor_Space thrpt 0.048 MB/sec * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.churn.G1_Survivor_Space.norm thrpt 0.001 B/op * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.count thrpt 298.000 counts * RegexVSQuickMatchBenchmark.notMatchQuickUriGrouping:路gc.time thrpt 358.000 ms * RegexVSQuickMatchBenchmark.notMatchRegex thrpt 3434953.426 ops/s * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.alloc.rate thrpt 8898.075 MB/sec * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.alloc.rate.norm thrpt 2856.206 B/op * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.churn.G1_Eden_Space thrpt 8886.568 MB/sec * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.churn.G1_Eden_Space.norm thrpt 2852.512 B/op * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.churn.G1_Survivor_Space thrpt 0.052 MB/sec * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.churn.G1_Survivor_Space.norm thrpt 0.017 B/op * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.count thrpt 306.000 counts * RegexVSQuickMatchBenchmark.notMatchRegex:路gc.time thrpt 377.000 ms ``` <!-- ==== 馃啎 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 馃憞 ==== ### <Feature description> - [ ] If this is non-trivial feature, paste the links/URLs to the design doc. - [ ] Update the documentation to include this new feature. - [ ] Tests(including UT, IT, E2E) are added to verify the new feature. - [ ] If it's UI related, attach the screenshots below. ==== 馃啎 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 馃憜 ==== --> - [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>. - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
