Hi. It appears that the Safari/webkit web inspector profiler samples stack traces approximately every 1ms. This is slow, and not suitable for many profiling tasks, since I'm only going to get a handful of samples when trying to hit 60fps, or react to an event in 50ms. By comparison, it appears that Chrome's Timeline profiler samples stacks every 100us. Is there a technical reason why WebKit's profiler can't go up to 10kHz? If there's a tradeoff (slow processing, significantly degraded performance), can this be made configurable?
<rdar://problem/66245375>
(In reply to radexpl from comment #0) > Hi. It appears that the Safari/webkit web inspector profiler samples stack > traces approximately every 1ms. This is slow, and not suitable for many > profiling tasks, since I'm only going to get a handful of samples when > trying to hit 60fps, or react to an event in 50ms. By comparison, it appears > that Chrome's Timeline profiler samples stacks every 100us. > > Is there a technical reason why WebKit's profiler can't go up to 10kHz? If > there's a tradeoff (slow processing, significantly degraded performance), > can this be made configurable? Last time I measured this it did negatively impact performance of the script being run, and we were trying to find a balance where we didn't introduce so much perturbation that the samples you got were unrepresentative. I also remember it being difficult to be woken up reliably in 100us. However, this was a long time ago. We should check again the impact of increasing the resolution.
Hi Saam! I wanted to bump this thread and ask again whether it's possible to increase WebKit's profiler resolution -- or at least make it a configurable option. I've just upgraded my Mac to an M1 machine, which exacerbates the issue even more -- the faster a dev machine is, the fewer samples for analysis I get. BTW: I'm not very familiar with the ins and outs of sampling profiling, but I do wonder if instead of being a hardcoded timer, the profiler sampler rate shouldn't be calculated/estimated off of CPU's speed - so that a program would get roughly the same number of samples regardless of how fast a machine is.