Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fully Automatic Mode #92

Open
nateberkopec opened this issue Apr 20, 2019 · 5 comments · May be fixed by #135
Open

Fully Automatic Mode #92

nateberkopec opened this issue Apr 20, 2019 · 5 comments · May be fixed by #135

Comments

@nateberkopec
Copy link
Collaborator

Showerthought.

The reason why benchmark/ips is so great is it helps us to set and decide on what would otherwise be pretty arbitrary parameters for benchmarks - particularly of course number of iterations.

I think we could go further.

  • A benchmark is "warmed up" when iterations of the benchmark don't get significantly faster.
  • Rather than just running for 5 seconds, a benchmark iteration can run until significance is achieved or a timeout is reached.
  • Once a result is achieved, it can be immediately replicated by iterating the benchmark again. If the result is replicated, stop. If it isn't replicated, try again, and if it doesn't replicate after X attempts, error out.

Just some ideas. I think I just want to get rid of the three remaining "config points" in benchmark/ips: warmup time, iteration runtime, and number of iterations.

@nateberkopec
Copy link
Collaborator Author

@mperham points out that Go's testing package may provide some ideas: https://golang.org/pkg/testing/#hdr-Benchmarks

@evanphx
Copy link
Owner

evanphx commented Apr 20, 2019

Sounds great! Let's do it!

@nateberkopec
Copy link
Collaborator Author

I think maybe the easiest to implement first would be auto-warmup.

What would be a reasonable configuration interface for this?

@ohaddahan
Copy link

Auto-warmup can be decided by how stable the latest iteration time was compared to the average / standard deviation.
BTW you can calculate both incrementally (to save N iteration of calculation on each pass, trying to decide on the warmup stopping condition):

https://ubuntuincident.wordpress.com/2012/04/25/calculating-the-average-incrementally/
http://jonisalonen.com/2013/deriving-welfords-method-for-computing-variance/

@evanphx evanphx linked a pull request Jan 13, 2024 that will close this issue
@evanphx
Copy link
Owner

evanphx commented Jan 13, 2024

@nateberkopec I've added a take at auto warmup using a fairly simple (but stable) approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants