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

add performance regression tests that can be tracked over git commit history #425

Open
timotheecour opened this issue Dec 6, 2020 · 0 comments

Comments

@timotheecour
Copy link
Owner

timotheecour commented Dec 6, 2020

Currently nim relies on very coarse performance benchmarks, see tests with timeout; this doesn't help with tracking over time (or git commit history for both compiler and stdlib) whether performance increases or decreases, it only helps identify when some test times out using a very coarse threshold (and in practice, these simply tend to be adjusted when threshold fails, see tests/vm/tslow_tables.nim). And in fact, performance of tables has regressed recently.

The goal of this RFC is to add a suite of reusable utilities (eg a std/benchmarks library) and individual benchmarks to enable precise tracking (and graphing) of performance over time (ie, git commit history), and report results as json, which can then be rendered in a subsequent time as plots (reporting both overall score and granular scores per-benchmark/compilation options/commit hash/commit time).

desired features

  • set of micro (eg: single function eg addInt) and macro (eg: more complex program) benchmarks to measure performance
  • a single / few tweakable parameters (eg --define:expectedDuration:numSeconds, --define:expectedMemory:numBytes) can be used to adjust each benchmark so that they run fast/with limited RAM (running in CI requires a budget) or can take longer/require more RAM and be more accurate (eg multiple restarts) to be run locally or on a dedicated VM
  • time machine: makes it easy to automate the task of running benchmarks at different points in nim's git history (possibly subsampled, between 2 commit hashes). This depends on nim-digger nim-digger: program to build nim at any revision (including forks/PRs) (cf D's digger); useful for git bisect #332 to build nim from past revisions
  • plotting tool: takes a json of benchmark results and plots them

example benchmarks

links

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

No branches or pull requests

1 participant