-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Overhead per test function call too large. #32
Comments
Original comment by holger krekel (BitBucket: hpk42, GitHub: hpk42): If you install (via -i http://pypi.testrun.org as usual) pytest-2.0.2.dev7 you get a little speedup. Can you verify how much on your machine? Oh, and if you run with "py.test --capture=sys" (simple capturing instead of fd-level capturing) or with no capturing "py.test -s" you may get some additional speedup. |
Original comment by Jurko Gospodnetić (BitBucket: jurko, GitHub: jurko): Just tried running: {{{ Using c:\program files\python\python32\lib\site-packages\pytest-2.0.2.dev6-py3.2.egg I did however manage to get a newer pylib dev8 version - not sure if that will help. Best regards, |
Original comment by Jurko Gospodnetić (BitBucket: jurko, GitHub: jurko): Just tested the 'py.test --capture=sys' command and it does seem to cut down the overhead to about 50%. Still not the 0.03 seconds for running everything as a single py.test test function call :-) but getting there...
Seems like the 'sys' capturing should be the default. :-) What exactly are the effects or one or the other type of capturing? More detailed failure reporting in case of fd-level capturing? If so, then that seems like something that should be enabled explicitly only when needed... Best regards, |
Original comment by Anonymous: You need the -U switch to force an upgrade maybe. |
Original comment by Jurko Gospodnetić (BitBucket: jurko, GitHub: jurko): Yup, that was it. Hmmm, sorry, not really at home with easy-install... was expecting it to upgrade to the latest version by default. The new pytest-2.0.2.dev7 version produced the following timings on my system:
|
Traced it's addition to an optimization as part of issue #32. The speedup was meant for a many-tests-in-a-file benchmark. For each test, `rootdir.bestrelpath(fspath of test)` is called, and the cache is of this slow `bestrelpath`. TODO
Originally reported by: Jurko Gospodnetić (BitBucket: jurko, GitHub: jurko)
pytest seems to have large overhead per test function call.
To demonstrate the effect try running the attached test script with its 'all_in_one' parameter set to:
In my test run I got the following times with 1000 assertions:
all_in_one = True ... 0.03 seconds.
all_in_one = False ... 5.44 seconds.
Hope this helps.
Best regards,
Jurko Gospodnetić
The text was updated successfully, but these errors were encountered: