Open Bug 1754620 Opened 4 years ago Updated 4 years ago

Reduce json footprint of low/zero-cpu samples

Categories

(Core :: Gecko Profiler, task, P3)

task

Tracking

()

People

(Reporter: mozbugz, Unassigned)

References

(Blocks 1 open bug)

Details

Output profiles contain samples at every single timestamp that the sampler thread loop ran.
This probably wastes a lot of space when samples are the same, and the CPU utilization may even be zero.

Some ideas:

  • First, measure how much space is taken by these low/zero-cpu samples, for some typical profiles. This may help gauge how important it would be to improve this situation, and also show how much is actually gained after some work is done.

  • The threads[n].samples.schema is currently stack-time-eventDelay-threadCPUDelta. If we reordered it to time-threadCPUDelta-stack-eventDelay, with absent/null stack meaning same-as-before (front-end work needed?), it should lead to smaller sample data overall: zero-cpu samples will only have the one timestamp, low-cpu samples with the same stack will only have two items, etc.

  • Following from the previous point, we could even not output timestamp-only samples in non-main threads, assuming the main thread would have the same (or very close) timestamp that the front-end could re-use.

  • And even then, main-thread timestamps alone may be low value -- they show that the sampler didn't even run, but seeing zero-cpu samples around these times may be enough clue that the process didn't get any work done.

  • If we get rid of zero-cpu samples, it may still be interesting to output the timestamps of the first and last samples of these zones.

Other ideas welcome.

You need to log in before you can comment on or make changes to this bug.