How should performance tests look like? #2193
Replies: 2 comments 1 reply
-
fpdf2 has a decorator From the usage it looks similar to the pytest-timeout decorator. |
Beta Was this translation helpful? Give feedback.
-
what I dislike with pytest-timeout is the name: a timeout is here to detect/prevent infinite loops : ensure_exec_time_below sound clearer |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The goal of performance tests is to discover catastrophic performance degradations (e.g. a critical loop becoming quadratic runtime from currently linear). It is not about benchmarking.
We want performance tests to be stable. They may not cause random timeouts.
We could use
pytest-timeout
(as a test decorator),time.time
, orthread_time
as shown in #2142How is this done in other libraries?
Key Decisions
Beta Was this translation helpful? Give feedback.
All reactions