richardstartin commented on a change in pull request #7405: URL: https://github.com/apache/pinot/pull/7405#discussion_r710147522
########## File path: pinot-segment-local/src/test/java/org/apache/pinot/segment/local/utils/nativefst/FSTBenchmarkTest.java ########## @@ -0,0 +1,220 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.pinot.segment.local.utils.nativefst; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.SortedMap; +import java.util.TreeMap; +import org.apache.pinot.segment.local.utils.nativefst.builders.FSTBuilder; +import org.apache.pinot.segment.local.utils.nativefst.utils.RegexpMatcher; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + + +/** + * This benchmark uses COCACorpus which constitutes of 51 million words and 1.5 million unique + * words. The benchmark runs a set of queries on Lucene FST and native FST and publishes numbers. + */ +public class FSTBenchmarkTest { Review comment: This benchmark would be better if you modelled the regexes as a parameter: ```java @Param({"q.[aeiou]c.*", ".*a", ...}) String regex; ``` For a few reasons: 1. You have less benchmark code this way 2. This prevents constant folding interfering with benchmark execution (this one is a big deal and why `@Param` exists) 3. You can see the regex in the JMH output which makes the results easier to interpret for others -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org