Git Product home page Git Product logo

golden's Introduction

golden

A benchmarking tool that measures and records runtime of any executable and also happens to know how to compile Nim.

  • cpp +/ nim-1.0 Build Status
  • arc +/ cpp +/ nim-1.3 Build Status

The idea here is that we're gonna make a record of everything we run, everything we build, and be able to discover and pinpoint regressions automatically using native git-fu performed by the tool. Fire and forget!

Installation

Nimph

$ nimph clone golden

Nimble

$ nimble install golden

Usage

If you pass it a binary, it'll run it a bunch of times and report some runtime statistics periodically.

If you pass it some Nim source, it will compile it for you and report some compilation and runtime statistics periodically.

By default, it will run until you interrupt it.

$ golden --truth=0.002 bench.nim
compilations after 0s
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Builds โ”‚ Min      โ”‚ Max      โ”‚ Mean     โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      1 โ”‚ 0.396129 โ”‚ 0.396129 โ”‚ 0.396129 โ”‚ 0.000000 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
benchmark after 1s
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Runs   โ”‚ Min      โ”‚ Max      โ”‚ Mean     โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      1 โ”‚ 1.959187 โ”‚ 1.959187 โ”‚ 1.959187 โ”‚ 0.000000 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
benchmark after 3s
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Runs   โ”‚ Min      โ”‚ Max      โ”‚ Mean     โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      2 โ”‚ 1.958892 โ”‚ 1.959187 โ”‚ 1.959039 โ”‚ 0.000147 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
completed benchmark after 5s
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Runs   โ”‚ Min      โ”‚ Max      โ”‚ Mean     โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      3 โ”‚ 1.958892 โ”‚ 1.961293 โ”‚ 1.959791 โ”‚ 0.001069 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Benchmarking the compilation of Nim itself:

$ cd ~/git/Nim
$ golden koch -- boot -d:danger
# ...
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ #      โ”‚ Min      โ”‚ Max      โ”‚ Mean     โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚     12 โ”‚ 8.846606 โ”‚ 9.485832 โ”‚ 8.945023 โ”‚ 0.165638 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Benchmarking compilation of slow-to-compile Nim:

$ golden --compilation openapi.nim
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      # โ”‚ Min       โ”‚ Max       โ”‚ Mean      โ”‚ StdDev   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      1 โ”‚ 91.946370 โ”‚ 91.946370 โ”‚ 91.946370 โ”‚ 0.000000 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚      # โ”‚ Min       โ”‚ Max       โ”‚ Mean      โ”‚ StdDev    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚      2 โ”‚ 29.271556 โ”‚ 91.946370 โ”‚ 60.608963 โ”‚ 31.337407 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Command Line Options

  • truth a float percentage indicating how much jitter you'll accept
  • runtime a float of seconds after which we should kill each invocation
  • iterations a number of invocations after which we should stop the benchmark
  • storage the path to a database file you wish to use; must end in .golden-lmdb
  • interactive-forced assume output friendly to humans
  • json-output assume output friendly to machines (work in progress)
  • color-forced enable color output when not in interactive mode
  • prune-outliers throw out this percentage of aberrant invocations with long runtime in order to clean up the histogram
  • dry-run don't write any results to the database
  • histogram-classes the number of points in the histogram
  • compilation-only benchmark the Nim compiler on the given source(s)
  • brief only output the statistics at the completion of the benchmark
  • never-output never emit anything via stdout/stderr
  • dump-output always print the stdout/stderr of the benchmarked program
  • -- the following arguments are passed to the compiler and runtime. Note that if you supply -- cpp for compilation via C++, you will need to supply your own defines such as -d:danger.

License

MIT

golden's People

Contributors

disruptek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

golden's Issues

Nimble Installation Fails

$ nimble install golden
Downloading https://github.com/disruptek/golden using git
  Verifying dependencies for [email protected]
      Info: Dependency on foreach@>= 1.0.2 already satisfied
  Verifying dependencies for [email protected]
 Installing [email protected]
Downloading https://github.com/ijneb/nimetry using git
       Tip: 9 messages have been suppressed, use --verbose to show them.
     Error: Downloaded package's version does not satisfy requested version range: wanted 0.1.2 got 0.4.0.
$ nim -v
Nim Compiler Version 1.0.2 [Linux: amd64]
Compiled at 2019-10-22
Copyright (c) 2006-2019 by Andreas Rumpf

git hash: 193b3c66bbeffafaebff166d24b9866f1eaaac0e
active boot switches: -d:release

crash in LMDB at runtime when compiled with -d:danger

Compilation of golden with -d:danger yields the following at runtime:

lmdb.nim(484)            setMaxDBs
asyncfutures.nim(383)    read
asyncfutures.nim(383)    read
Error: unhandled exception: Invalid argument
Async traceback:
  lmdb.nim(484)         setMaxDBs
  asyncfutures.nim(383) read
Exception message: Invalid argument
Exception type: [Exception]

Can't install with nimble: nimterop versions

Trying to install golden with nimble, to use it with nim 1.4, raise an install error on nimterop versions:

$ nimble install golden --verbose | grep -B 5 -A 2 nimterop
    Reading official package list
   Checking for nimgit2@>= 0.3.1 & < 0.4.0
      Info: Dependency on nimgit2@>= 0.3.1 & < 0.4.0 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for nimterop@>= 0.6.3
      Info: Dependency on nimterop@>= 0.6.3 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for regex@>= 0.15.0
--
    Reading official package list
   Checking for https://github.com/disruptek/badresults@< 2.0.0
      Info: Dependency on https://github.com/disruptek/badresults@< 2.0.0 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for nimterop@<= 0.6.12
      Info: Dependency on nimterop@<= 0.6.12 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for regex@>= 0.15.0
--
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for unicodedb@>= 0.8.0
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
     Error: Cannot satisfy the dependency on nimterop 0.6.12 and nimterop 0.6.13

I can't find which package requires nimterop 0.6.12 and why such a version restriction has been set.

Can't install with nimble

Trying to install golden with nimble, to use it with nim 1.4, raise an install error on nimterop versions:

$ nimble install golden --verbose | grep -B 5 -A 2 nimterop
    Reading official package list
   Checking for nimgit2@>= 0.3.1 & < 0.4.0
      Info: Dependency on nimgit2@>= 0.3.1 & < 0.4.0 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for nimterop@>= 0.6.3
      Info: Dependency on nimterop@>= 0.6.3 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for regex@>= 0.15.0
--
    Reading official package list
   Checking for https://github.com/disruptek/badresults@< 2.0.0
      Info: Dependency on https://github.com/disruptek/badresults@< 2.0.0 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for nimterop@<= 0.6.12
      Info: Dependency on nimterop@<= 0.6.12 already satisfied
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for regex@>= 0.15.0
--
  Verifying dependencies for [email protected]
    Reading official package list
   Checking for unicodedb@>= 0.8.0
      Info: Dependency on unicodedb@>= 0.8.0 already satisfied
  Verifying dependencies for [email protected]
     Error: Cannot satisfy the dependency on nimterop 0.6.12 and nimterop 0.6.13

I can't find which package requires nimterop 0.6.12 and why such a version restriction has been set.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.