Run the JSON dumps in the writer thread rather than in the profiling thread. In my anecdotal example this increases overall profiled script runtime performance by ~30%
Don't stop the writer thread until it's been signaled and the queue is empty. Otherwise output may be truncated prematurely. This is the source of the "Did not finish" events, as well as some that are just missing.
Run the JSON
dumps
in the writer thread rather than in the profiling thread. In my anecdotal example this increases overall profiled script runtime performance by ~30%Don't stop the writer thread until it's been signaled and the queue is empty. Otherwise output may be truncated prematurely. This is the source of the "Did not finish" events, as well as some that are just missing.
Ensure the output is valid JSON in the test