How to do “performance-based” (benchmark) unit testing in Python

后端 未结 4 956
粉色の甜心
粉色の甜心 2021-02-03 12:48

Let\'s say that I\'ve got my code base to as high a degree of unit test coverage as makes sense. (Beyond a certain point, increasing coverage doesn\'t have a good ROI.)

4条回答
  •  日久生厌
    2021-02-03 12:59

    While I agree that testing performance at a system level is ultimately more relevant, if you'd like to do UnitTest style load testing for Python, FunkLoad http://funkload.nuxeo.org/ does exactly that.

    Micro benchmarks have their place when you're trying to speed up a specific action in your codebase. And getting subsequent performance unit tests done is a useful way to ensure that this action that you just optimized does not unintentionally regress in performance upon future commits.

提交回复
热议问题