1996fanrui commented on code in PR #77: URL: https://github.com/apache/flink-benchmarks/pull/77#discussion_r1251410570
########## src/main/java/org/apache/flink/benchmark/WatermarkAggregationBenchmark.java: ########## @@ -0,0 +1,75 @@ +/* + * 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.flink.benchmark; + +import org.apache.flink.runtime.source.coordinator.SourceCoordinatorAlignmentBenchmark; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.runner.Runner; +import org.openjdk.jmh.runner.RunnerException; +import org.openjdk.jmh.runner.options.Options; +import org.openjdk.jmh.runner.options.OptionsBuilder; +import org.openjdk.jmh.runner.options.VerboseMode; + +/** The watermark aggregation benchmark for source coordinator when enabling the watermark alignment. */ +@BenchmarkMode(Mode.AverageTime) Review Comment: Following is the benchmark result of my work Mac: ``` The master branch with https://github.com/apache/flink/pull/22852 Benchmark Mode Cnt Score Error Units WatermarkAggregationBenchmark.aggregateWatermark thrpt 10 1531.221 ± 45.514 ops/ms The master branch Benchmark Mode Cnt Score Error Units WatermarkAggregationBenchmark.aggregateWatermark thrpt 10 17.743 ± 0.326 ops/ms ``` 1531 ops/ms ~= (5000/1531) 3.26 ms/invocation, it's close and better than the previous one(3.54 ms/op). The little improvement may be due to we removed the `RANDOM` and `System.currentTimeMillis()` during benchmarking. No matter which Mac or server, I am sure to see a huge performance improvement with https://github.com/apache/flink/pull/22852. -- 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]
