-
Notifications
You must be signed in to change notification settings - Fork 241
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
Performance regression in pytest-html 4.0.0 #751
Comments
Any idea where the bottle neck might be? If not, maybe an option to defer rendering until the suite is finished might fix it. |
@akhilramkee Thanks for the profile! 🙏 We can potentially drop Regardless, that confirms my initial thought that it's the generate-report-for-every-test that is the bigger issue here. Maybe that should be an ini-option and we change the default back to what it was in v3. e.g. generate report once entire suite if finished? WDYT? |
Just realized that this PR #753 should speed things up as well. Currently we generate the report for each "when" (setup, call, teardown) and also for each rerun. That PR makes it so that the report is only generated once per complete test. |
creating the reports after the run should also solve #741 by moving the fs access out of the line |
Yeah, we've now got at least three issues that all seem to stem from the generation. So I'll definitely make that optional. |
Yeah this sounds good! |
Mind testing https://pypi.org/project/pytest-html/4.0.3rc0/ @akhilramkee ? |
My reproducer does indicate that run time is back to normal with
Thanks for the quick turnaround! |
It even looks to be slightly faster: 0.71s vs 1.10s 🥳
Thanks for reporting and helping me test! <3 |
I'm going to see if there are any other issues I can fix, and then release a proper 4.0.3 |
Hello @akhilramkee , just for curiosity, which tool or command did you use get this analysis ? |
Used |
pytest-html 4 (Takes 6s)
pytest-html 3.2 (Takes 1s)
To reproduce:
File structure:
tests_sample.py
This slowness with pytest-html 4.0.0 is more pronounced in larger test suites (100K tests - tweaking the random_values count also shows the same), as the test execution took a 14+ hours with 90% of the execution time being taken by pytest-html to render the results.
Profile sample: Link
The text was updated successfully, but these errors were encountered: