Skip to content

Instantly share code, notes, and snippets.

@marcelcaraciolo
Created May 25, 2013 14:07
Show Gist options
  • Save marcelcaraciolo/5649171 to your computer and use it in GitHub Desktop.
Save marcelcaraciolo/5649171 to your computer and use it in GitHub Desktop.
common_setup = """
import numpy
from crab.metrics import cosine_distances
X = numpy.random.uniform(1,5,(1000,))
"""
bench = Benchmark(statement, setup_bk1, name="Crab Cosine")
suite = BenchmarkSuite()
suite.append(bench)
statement = "cosine_distances(X, X)"
runner = BenchmarkGitRunner(suite, '.', 'Absolute timing in ms')
n_benchs, results = runner.run()
runner.plot_history(results)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment