Skip to content

Conversation

@ericl
Copy link
Contributor

@ericl ericl commented Jun 2, 2016

What changes were proposed in this pull request?

This makes microbenchmarks run for at least 2 seconds by default, to allow some time for jit compilation to kick in.

How was this patch tested?

Tested manually with existing microbenchmarks. This change is backwards compatible in that existing microbenchmarks which specified numIters per-case will still run exactly that number of iterations. Microbenchmarks which previously overrode defaultNumIters now override minNumIters.

cc @hvanhovell

val timer = new Benchmark.Timer(i)
f(timer)
val runTime = timer.totalTime()
if (i > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a left-over from the previous version. Any idea why it was added? One warm-up period?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe so. I would not be opposed to removing it.

@SparkQA
Copy link

SparkQA commented Jun 2, 2016

Test build #59869 has finished for PR 13472 at commit 27d1c28.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 3, 2016

Test build #59898 has finished for PR 13472 at commit 239ee6e.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@ericl
Copy link
Contributor Author

ericl commented Jun 3, 2016

In the interest of more reproducible results, added a warmup time and option to output to a file. cc @JoshRosen

@SparkQA
Copy link

SparkQA commented Jun 3, 2016

Test build #59957 has finished for PR 13472 at commit e67443f.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 4, 2016

Test build #59973 has finished for PR 13472 at commit ead4a2c.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

defaultNumIters: Int = 5,
outputPerIteration: Boolean = false) {
minNumIters: Int = 2,
warmupTime: FiniteDuration = 2.seconds,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like to add a warmup period, but is it better to 2 second as default. It depends on machine, program (we can specify a value explicitly), and others.
Are there any other thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@SparkQA
Copy link

SparkQA commented Jun 6, 2016

Test build #60063 has finished for PR 13472 at commit 2d24842.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Jun 6, 2016

Test build #60061 has finished for PR 13472 at commit ea89fc7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@JoshRosen
Copy link
Contributor

This seems good to me. @hvanhovell, did you have any comments / do you want to do the final sign-off?

@hvanhovell
Copy link
Contributor

LGTM

@hvanhovell
Copy link
Contributor

Merging to master/2.0

asfgit pushed a commit that referenced this pull request Jun 8, 2016
## What changes were proposed in this pull request?

This makes microbenchmarks run for at least 2 seconds by default, to allow some time for jit compilation to kick in.

## How was this patch tested?

Tested manually with existing microbenchmarks. This change is backwards compatible in that existing microbenchmarks which specified numIters per-case will still run exactly that number of iterations. Microbenchmarks which previously overrode defaultNumIters now override minNumIters.

cc hvanhovell

Author: Eric Liang <[email protected]>
Author: Eric Liang <[email protected]>

Closes #13472 from ericl/spark-15735.

(cherry picked from commit 4e8ac6e)
Signed-off-by: Herman van Hovell <[email protected]>
@asfgit asfgit closed this in 4e8ac6e Jun 8, 2016
zjffdu pushed a commit to zjffdu/spark that referenced this pull request Jun 10, 2016
## What changes were proposed in this pull request?

This makes microbenchmarks run for at least 2 seconds by default, to allow some time for jit compilation to kick in.

## How was this patch tested?

Tested manually with existing microbenchmarks. This change is backwards compatible in that existing microbenchmarks which specified numIters per-case will still run exactly that number of iterations. Microbenchmarks which previously overrode defaultNumIters now override minNumIters.

cc hvanhovell

Author: Eric Liang <[email protected]>
Author: Eric Liang <[email protected]>

Closes apache#13472 from ericl/spark-15735.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants