YangSiJun528 commented on code in PR #2441: URL: https://github.com/apache/iggy/pull/2441#discussion_r2591369793
########## foreign/java/microbenchmarks/src/main/java/org/apache/iggy/benchmark/SimpleDemoMicrobenchmark.java: ########## @@ -0,0 +1,55 @@ +/* + * 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.iggy.benchmark; + +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.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +import java.util.concurrent.TimeUnit; + +@State(Scope.Benchmark) +@Fork(value = 1) +@Warmup(iterations = 3) +@Measurement(iterations = 5) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.MILLISECONDS) +public class SimpleDemoMicrobenchmark { + + @Benchmark + public String stringConcatenation() { Review Comment: I don't think JMH is suitable for performing the tasks that `iggy bench` does, as JMH is designed for microbenchmarking, not end-to-end benchmarking. It would be appropriate for performance testing Java SDK code like message serialization, deserialization, and parsing logic. However, JMH doesn't provide time series data or moving averages that `iggy bench` offers. If we need these features, building a separate `java-bench` tool would be cleaner than using JMH. I propose holding this PR until we identify suitable microbenchmark targets for the Java SDK. Alternatively, we could merge this PR now and add real microbenchmarks later when appropriate targets are found. -- 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]
