Comments (8)
Hi @patroqueeet, how are you invoking pyinstrument?
from pyinstrument.
sry for the slight delay :/
in docker I do docker-compose exec app pyinstrument ./manage.py test --keepdb services.rest.tests.test_views:AddCompanyTestCase.test_add_company -v 3./manage.py test --keepdb services -e functional -v 2 --failed
Generally spoken: intention is to identify what slows down my tests... including setUp()
etc.
from pyinstrument.
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?
from pyinstrument.
@joerick sure. will go and make a docker image for you to reproduce...
from pyinstrument.
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...
from pyinstrument.
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 gettimeofday
syscall in pyinstrument_cext - perhaps this is slower in some Docker containers. This article might add some weight to the idea...
from pyinstrument.
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 usleep
. Perhaps this would be worse performance for systems with vDSO, but it would definitely improve things otherwise...
from pyinstrument.
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.
from pyinstrument.
Related Issues (20)
- Significant performance overhead when timing requires a syscall on Linux HOT 18
- Question, missing Async-mode flag at running as module HOT 4
- Pyinstrument hiding useful frames HOT 8
- Automatic Web Deployment HOT 1
- Interpolation bug in jupyter magic HOT 3
- replace deprecated appdirs with platformdirs HOT 1
- HTML Renderer show-all HOT 2
- `pytinstrument` does not track the call stack of `__aenter__` and `__aexit__`
- Console renderer has much more detail than speedscope renderer HOT 1
- pstats renderer total time HOT 4
- nevergrad import fails when profiler is active HOT 3
- Profiler().write_html() does not accept "show_all" argument, in contrast with API docs HOT 3
- Asyncio background tasks are added to total wall clock time
- recursive functions HOT 2
- Memory consumption increases when profiling in an iteration
- [bug] pyinstruments not working TypeError: 'NoneType' object is not callable
- Example on how to disable profiling in FastAPI tests
- RuntimeError: cannot release un-acquired lock w/ gevent
- Pyinstrument ProfilerState object is not callable HOT 1
- profiler.output_text: float division by zero HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyinstrument.