-
Notifications
You must be signed in to change notification settings - Fork 235
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
pyinstrument is very slow on django tests with docker #83
Comments
Hi @patroqueeet, how are you invoking pyinstrument? |
sry for the slight delay :/ in docker I do Generally spoken: intention is to identify what slows down my tests... including |
Not sure what's going on here tbh... my tests in Docker seem to work just as normal. Are you able to make a minimal recreation? |
@joerick sure. will go and make a docker image for you to reproduce... |
Hey, tried with a simple model test on docker and found all working as expected. But the problems come on a large Py3 project. Hence, closing this until I have some further reproducible truth. Still: for the records https://stackoverflow.com/questions/62220875/profiling-python-in-a-docker-container-is-very-slow-cprofile-and-pyinstrument more people having this issue... |
Thanks for taking another look! If the problem occurs in cProfile too, it's probably at a lower level than we can fix. A wild guess at the cause would have me thinking about the |
I had a thought on this - pyinstrument_cext could add a feature where, rather than calling gettimeofday on every trace event, it checks an internal variable that's being incremented by a thread who is running in a tight loop doing |
hey, to be honest, I cannot judge if your wild guess is going in the right direction. if you provide me a branch/PR I can check it out and give you some feedback. |
This should now be resolved, using either coarse timers or timing threads on Docker. See the v4.7.0 release notes for info. |
Dear,
I'm trying to use pyinstrument on docker with a django test setup. When I run the command like this
./manage.py test --keepdb services.rest.tests.test_views:AddCompanyTestCase.test_add_company -v 3
I get something likewhere even
now
takes 6s. Without pyinstrument this test takes about ~30s and I need to find out why...What other information do you need from my side?
The text was updated successfully, but these errors were encountered: