benchmark-runner

Last updated: 2019-06-10 16:29:49 +0100

Upstream URL: git clone http://chriswarbo.net/git/benchmark-runner.git

Repo

View repository

View issue tracker

Contents of README follows


ASV Benchmark Runner

The Nix derivation in default.nix allows a Git repository to be benchmarked using Airspeed Velocity (ASV). This is useful for continuous integration, since normally we will only get a single Git revision (to aid reproducibility, Nix deletes the .git directory by default), whilst ASV wants access to all of the commits in order to benchmark them.

Usage

The default.nix file defines a function. This should be called with an attrset of arguments, including a repo attribute containing the URL (remote or local) of the desired Git repository. This can be done “manually”, or if you’re on Hydra by setting it as a build input.

Other arguments are optional, and include:

Notes on Caching

Using a cache can be a huge performance gain, especially when benchmarking the same repos over and over (e.g. a build server watching for new commits). However it also makes our derivations impure. It’s up to you whether that’s worth it.

Many repo’s results can co-exist in the same cache, since we identify them by hashing the relevant ASV config file. This means that changing the config file will cause old commits to be benchmarked from scratch. Whilst this may be inconvenient in some circumstances (e.g. if the benchmarks haven’t changed, and there are thousands of existing results), we consider this behaviour to be reasonable since it is simple and predictable. If you want to re-use results in a “smarter” way (AKA more complicated/fragile/confusing/etc.), feel free to write your own scripts to copy the cache contents around.

Note that you should probably avoid giving a Nix path value (e.g. /tmp/cache) as a cacheDir argument, and should almost always use a Nix string value instead (e.g. "/tmp/cache"). This is because Nix copies path values to its store, and passes those immutable copies to the build scripts. This would prevent new results getting copied to the cache.