rohdesamuel commented on code in PR #25354:
URL: https://github.com/apache/beam/pull/25354#discussion_r1105099337


##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/debug/DataSamplingDescriptorModifier.java:
##########
@@ -0,0 +1,49 @@
+/*
+ * 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.beam.fn.harness.debug;
+
+import org.apache.beam.fn.harness.ProcessBundleDescriptorModifier;
+import org.apache.beam.model.fnexecution.v1.BeamFnApi;
+import org.apache.beam.model.pipeline.v1.RunnerApi;
+
+/**
+ * Modifies the given ProcessBundleDescriptor by adding a DataSampling 
operation as a consumer to
+ * every PCollection.
+ */
+public class DataSamplingDescriptorModifier implements 
ProcessBundleDescriptorModifier {

Review Comment:
   I think the problem was that I was measuring the null hypothesis at upstream 
head, instead of origin head. I re-ran the benchmark and saw that the benchmark 
at origin is the same as data sampling enabled. Maybe there were some changes 
that resulted in some performance differences?
   
   **yes sampling (with atomics)**
   Benchmark                                Mode  Cnt     Score    Error  Units
   ProcessBundleBenchmark.testLargeBundle  thrpt   15  1584.137 ± 18.961  ops/s
   :sdks:java:harness:jmh:jmh (Thread[included builds,5,main]) completed. Took 
5 mins 11.907 secs.
   
   **no data sampling**
   Benchmark                                Mode  Cnt     Score    Error  Units
   ProcessBundleBenchmark.testLargeBundle  thrpt   15  1699.238 ± 16.382  ops/s
   :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 4,5,main]) 
completed. Took 5 mins 11.424 secs.
   
   **at upstream head**
   Benchmark                                Mode  Cnt     Score    Error  Units
   ProcessBundleBenchmark.testLargeBundle  thrpt   15  1737.774 ± 34.448  ops/s
   :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 4,5,main]) 
completed. Took 5 mins 8.815 secs.
   
   **at origin head**
   Benchmark                                Mode  Cnt     Score    Error  Units
   ProcessBundleBenchmark.testLargeBundle  thrpt   15  1698.047 ± 17.290  ops/s
   :sdks:java:harness:jmh:jmh (Thread[Execution worker Thread 4,5,main]) 
completed. Took 5 mins 10.494 secs.



-- 
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]

Reply via email to