From the course: Faster Python Code

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Benchmarks

Benchmarks - Python Tutorial

From the course: Faster Python Code

Start my 1-month free trial

Benchmarks

- [Instructor] A lot of teams have a continuous-integration, or CI systems, such as Jenkins. These systems run a test suite every time there's a change to the code. You should also include benchmarks in your code and save the results of these benchmarks to a file or database. This way, you can see if the new code decreased performance or improved it. As a rule of thumb, you want to see benchmarks staying the same up to a given threshold, or getting better. Discussing benchmark figures as a part of the daily standup will do wonders for performance awareness in your team. For an example of how to do this, check out PyPy's Speed Center site. As you can see in this site, they have benchmarks comparing PyPy to CPython. They also have one section for changes. You can analyze the timeline and you can do comparison. A nice tool that can help you is pytest-benchmark. This is a plugin to the popular pytest test suite. This…

Contents