Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Increase Chrome profiler sampling rate

From looking online, it appears as if the chrome profiler samples 1000 times a second. This seems to be a reasonable default that balances information collection without high overhead. However, i'm finding the default to be not aggressive enough for my current task.

I was wondering if there was a way to configure this default so i could try a few more values. I'm absolutely willing to take the increased overhead while smapling this task.

Thanks!

like image 965
Cyrus Najmabadi Avatar asked Jun 13 '26 09:06

Cyrus Najmabadi


2 Answers

There's high resolution profiling option in DevTools settings. If enabled it will sample with 10kHz rate.

like image 191
alph Avatar answered Jun 18 '26 00:06

alph


Use option --prof-sampling-interval (not --cpu-profiler-sampling-interval, which doesn’t work on my machine) in the d8 command:

./d8 --prof-sampling-interval=1000000 xx.js --prof

The option means sampling interval in ms. Default value is 1000, which means sampling per us.

like image 21
rigel Avatar answered Jun 17 '26 23:06

rigel