Github user ericl commented on a diff in the pull request:
https://github.com/apache/spark/pull/13472#discussion_r65821495
--- Diff: core/src/main/scala/org/apache/spark/util/Benchmark.scala ---
@@ -33,18 +38,37 @@ import org.apache.commons.lang3.SystemUtils
*
* The benchmark function takes one argument that is the iteration that's
being run.
*
- * If outputPerIteration is true, the timing for each run will be printed
to stdout.
+ * @param name name of this benchmark.
+ * @param valuesPerIteration number of values used in the test case, used
to compute rows/s.
+ * @param minNumIters the min number of iterations that will be run per
case, not counting warm-up.
+ * @param warmupTime amount of time to spend running dummy case iterations
for JIT warm-up.
+ * @param minTime further iterations will be run for each case until this
time is used up.
+ * @param outputPerIteration if true, the timing for each run will be
printed to stdout.
+ * @param output optional output stream to write benchmark results to
*/
private[spark] class Benchmark(
name: String,
valuesPerIteration: Long,
- defaultNumIters: Int = 5,
- outputPerIteration: Boolean = false) {
+ minNumIters: Int = 2,
+ warmupTime: FiniteDuration = 2.seconds,
--- End diff --
I suppose the relevant tradeoff here is accuracy vs time added to
benchmark. I'd like to pick a value that is a reasonable default for most
benchmarks - probably 2-5 seconds to warm up the jit reasonably depending on
the program. Those with specialized needs can override it as needed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]