profile
The profile
snippet activates profile
mode, enabling performance monitoring for specific snippets.
This mode uses the Performance API to mark key points (like the beginning and end of the main logic in a snippet) and measure the elapsed time between them, expressed in milliseconds (ms).
When used, it logs an object containing performance data for the monitored snippet.
Rounded values in Firefox
Firefox reduces the precision of timestamps to protect user privacy, which can result in rounded values such as 0 or 1.
To address this, you can adjust the privacy.reduceTimerPrecision
setting in about:config
:Open Firefox and type about:config
in the address bar.Search for privacy.reduceTimerPrecision
.Toggle the setting to false.Verify if the duration values now include decimals.
If you continue to see rounded values, you may also want to toggle the privacy.resistFingerprinting
setting.
Use cases
The profile
snippet is ideal for monitoring the performance of specific snippets. It is particularly useful when combined with behavioral or conditional hiding snippets.
Filter examples
The table below provides examples of filters that use the profile
snippet:
profile; abort-on-property-read atob
Activates profile
mode for the abort-on-property-read
snippet, logging its performance whether it succeeds or fails.
profile; debug; abort-on-property-read atob
Combines profile
mode with debug
for enhanced monitoring and debugging.
Last updated
Was this helpful?