Even though py-spy is a sampling profiler and the timelines should not be trusted, the speedscope format allows for multiple parallel timelines. At a sufficiently course sampling granularity (assuming no skipped steps), these timelines can be usefully correlated if we had the relative offset between them.
Even though
py-spy
is a sampling profiler and the timelines should not be trusted, thespeedscope
format allows for multiple parallel timelines. At a sufficiently course sampling granularity (assuming no skipped steps), these timelines can be usefully correlated if we had the relative offset between them.If we saved the current timestamp when taking the first sample of a new process/thread around here: https://github.com/benfred/py-spy/blob/master/src/speedscope.rs#L220-L227
And added that offset to
start_value
andend_value
here: https://github.com/benfred/py-spy/blob/master/src/speedscope.rs#L144-L145That would allow correlating timelines between threads/processes.