Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@acj
Copy link
Member

@acj acj commented Nov 8, 2022

Resolves #367. When sampling multiple processes, the order in which the samples arrive at the stats recorder is nondeterministic. That can result in awkward calculations where the previous sample seems to have arrived after the current one.

There are several options for handling this. We could drop the current sample, or calculate the elapsed time backwards (treat the previous time as the next one), or assume that the timestamps arrived at the same time, etc. This workaround uses the latter. That is, we assume that no time has elapsed between the "previous" sample and the one that we're currently processing.

@saunderst, WDYT?

@saunderst
Copy link
Contributor

From the bug report, it seems as though this rarely happens, so this is a nice simple workaround that probably won't meaningfully impact the results. πŸ‘

The only improvement I can think of is actually swapping the samples (added complexity and overhead for dubious value πŸ‘Ž).

@acj
Copy link
Member Author

acj commented Nov 10, 2022

Thanks!

@acj acj merged commit 296f7d4 into rbspy:main Nov 10, 2022
@acj acj deleted the issue-367 branch November 10, 2022 23:56
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

Successfully merging this pull request may close these issues.

Profiling multiple subprocesses fails in 0.12.1

2 participants