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.
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:
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?
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.
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?