HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Script Preparation code:
 
/*your preparation JavaScript code goes here
To execute async code during the script preparation, wrap it as function globalMeasureThatScriptPrepareFunction, example:*/
async function globalMeasureThatScriptPrepareFunction() {
    // This function is optional, feel free to remove it.
    // await someThing();
}
Tests:
  • actual

    x
     
    (function() {
        var loadTimeout = 5000;
        var loadFired = false;
        var timeoutFallback;
        
        function onWindowLoad() {
            if (!loadFired) {
                loadFired = true;
                clearTimeout(timeoutFallback);
                window.dataLayer = window.dataLayer || [];
                window.dataLayer.push({
                    'event': 'window_load'
                });
            }
        }
        function fallback() {
            if (!loadFired) {
                loadFired = true;
                window.dataLayer = window.dataLayer || [];
                window.dataLayer.push({
                    'event': 'load_fallback'
                });
            }
        }
        window.addEventListener('load', onWindowLoad);
        timeoutFallback = setTimeout(fallback, loadTimeout);
    })();
  • future

     
    (function() {
        var loadTimeout = 5000;
        var loadFired = false;
        var timeoutFallback;
        
        function onWindowLoad() {
            if (loadFired) {
                return;
            }
            
            loadFired = true;
            clearTimeout(timeoutFallback);
            window.dataLayer = window.dataLayer || [];
            window.dataLayer.push({
                'event': 'window_load'
            });
        }
        
        function fallback() {
            if (loadFired) {
                return;
            }
            
            loadFired = true;
            window.dataLayer = window.dataLayer || [];
            window.dataLayer.push({
                'event': 'load_fallback'
            });
        }
        
        window.addEventListener('load', onWindowLoad);
        timeoutFallback = setTimeout(fallback, loadTimeout);
    })();
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    actual
    future

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one month ago)
Mozilla/5.0 (iPhone; CPU iPhone OS 18_2_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/133.0.6943.84 Mobile/15E148 Safari/604.1
Chrome Mobile iOS 133 on iOS 18.2.1
View result in a separate tab
Test name Executions per second
actual 3522.6 Ops/sec
future 0.5 Ops/sec