Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Last active December 15, 2015 06:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelcaraciolo/5219238 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/5219238 to your computer and use it in GitHub Desktop.
runner = BenchmarkRunner(suite, '.', 'Cosine benchmarks')
n_benchs, results = runner.run()
fig = runner.plot_relative(results, horizontal=True, logy=True)
plt.savefig('%s.png' % runner.name.replace(' ', '_')) # bbox_inches='tight')
runner.plot_absolute(results, horizontal=False, logy=True)
plt.savefig('%s.png' % runner.name.replace(' ', '_')) # bbox_inches='tight')
rst_text = runner.to_rst(results, runner.name.replace(' ', '_') + 'png',
runner.name.replace(' ', '_') + '_r.png')
with open('bench.rst', 'w') as f:
f.write(rst_text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment