Skip to content

Fix performance regression from version 4.0.0 #386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 8, 2020
Merged

Conversation

youtux
Copy link
Contributor

@youtux youtux commented Sep 8, 2020

#384 introduced a performance regression caused by inspect.stack().

To give an idea of the size of the problem, collecting tests from a test suite with ~7000 test is 7x slower than it used to be in pytest 3.2.1.

v3.2.1 v4.0.0 v4.0.0 with fix
collect time 51s 367s 43s
1x 7.19x 0.84x

This PR addresses the issue by using lower-level api calls (sys._getframe + inspect.getframeinfo)

@codecov
Copy link

codecov bot commented Sep 8, 2020

Codecov Report

Merging #386 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #386   +/-   ##
=======================================
  Coverage   95.24%   95.25%           
=======================================
  Files          49       49           
  Lines        1705     1707    +2     
  Branches      169      169           
=======================================
+ Hits         1624     1626    +2     
  Misses         46       46           
  Partials       35       35           
Impacted Files Coverage Δ
pytest_bdd/utils.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6ca1df9...a1a3001. Read the comment docs.

@youtux youtux merged commit a8c1ff4 into master Sep 8, 2020
@youtux youtux deleted the fix-performance-issue branch September 8, 2020 09:59
@youtux
Copy link
Contributor Author

youtux commented Sep 8, 2020

Version 4.0.1 is released to PyPI with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant