vbench: lightweight performance testing for Python

31,164 views
31,614 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
31,164
On SlideShare
0
From Embeds
0
Number of Embeds
27,987
Actions
Shares
0
Downloads
27
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

vbench: lightweight performance testing for Python

  1. 1. vbench: lightweight performance testing Wes McKinney @wesmckinn PyCon 2012Sunday, March 11,
  2. 2. Why do we test?Sunday, March 11,
  3. 3. Freedom from fearSunday, March 11,
  4. 4. Testing for performance?Sunday, March 11,
  5. 5. Who made my code slower???Sunday, March 11,
  6. 6. Sunday, March 11,
  7. 7. Who made my code slower???Sunday, March 11,
  8. 8. MeSunday, March 11,
  9. 9. speed.pypy.org is a one-off solutionSunday, March 11,
  10. 10. Stop. Help is near • GitHub: wesm/vbench • Integrates with git: runs benchmarks for each revision in your repo • Persists results locally in SQLite • Generates graphs using matplotlibSunday, March 11,
  11. 11. Catch performance regressions soonerSunday, March 11,
  12. 12. Writing vbenchmarks setup = common_setup + """ setup values = np.concatenate([np.arange(100000), np.random.randn(100000), np.arange(100000)]) s = Series(values) """ stats_rank_average = Benchmark(s.rank(), setup)Sunday, March 11,
  13. 13. Use them in your workflow In [2]: stats_rank_average.run() Out[2]: {loops: 10, repeat: 3, succeeded: True, timing: 33.135390281677246, units: ms} Same code as %timeit in IPythonSunday, March 11,
  14. 14. Get involved • A useful weekend hack • git bisect integration • More version control systems • Upload results to codespeed instance • More setup/teardown controlSunday, March 11,
  15. 15. GitHub: wesm/vbench @wesmckinnSunday, March 11,

×