mrk-andreev commented on PR #48501:
URL: https://github.com/apache/spark/pull/48501#issuecomment-2480474218

   I would like to point out that the current implementation of 
org.apache.spark.benchmark.Benchmark::addCase does not use any form of 
Blackhole ([Blackhole in 
JMH](https://github.com/openjdk/jmh/blob/master/jmh-core/src/main/java/org/openjdk/jmh/infra/Blackhole.java#L155)),
 which could lead to dead-code elimination. However, I have not observed this 
issue in the existing tests. This is likely due to the complexity and side 
effects of the code being benchmarked, which prevents such elimination.
   
   Would it be a good idea to consider adding this as a feature in the future?
   
   ---
   # Context
   
   `org.apache.spark.benchmark.Benchmark::addCase`
   
   ```
     def addCase(name: String, numIters: Int = 0)(f: Int => Unit): Unit = {
       addTimerCase(name, numIters) { timer =>
         timer.startTiming()
         f(timer.iteration)
         timer.stopTiming()
       }
     }
   ```


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to