Skip to content
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

speedgraph startValue is always 0 #544

Open
dvarrazzo opened this issue Dec 24, 2022 · 0 comments
Open

speedgraph startValue is always 0 #544

dvarrazzo opened this issue Dec 24, 2022 · 0 comments

Comments

@dvarrazzo
Copy link

Hello,

I am trying to debug a concurrency problem in psycopg 3, namely the fact that thread don't seem to run in parallel as much as in psycopg 2. In py-spy flamegraphs of multithread runs I can see long spells of time spent trying to acquire the GIL after sections in which it was released.

image

What I need is to answer the question: "when thread t is locked on GIL acquisition, which thread has the control, and what is it doing?"

I have tried to use the speedgraph to answer this question. Unfortunately it seems that the startValue for each Profile is always 0:

https://github.com/benfred/py-spy/blob/master/src/speedscope.rs#L144

As a consequence, two threads' profiles cannot be aligned precisely and the question of what a thread is doing cannot be answered consistently.

Would it be possible to set startValue either to the absolute start time of the thread, or to a relative time starting from the first thread start, so that the threads profiles can be aligned?

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

No branches or pull requests

1 participant