Script Preparation code:
x
 
var audio = document.createElement("audio");
function andAOne(e){ 
  e.count = (e.count|| 0) +1; 
}
function andAOneAndAStop(e){ 
  e.count = (e.count|| 0) +1; 
  e.count === 501 && e.stopPropagationImmediately();
}
Tests:
  • running async 1000 event listeners

     
    for (var i = 0; i <1000; i++)
      audio.addEventListener("ratechange",andAOne.bind({}));
    audio.playbackRate = 2;
  • running async 501 event listeners

     
    for (var i = 0; i <1000; i++)
      audio.addEventListener("ratechange",andAOneAndAStop.bind({}));
    audio.playbackRate = 2;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    running async 1000 event listeners
    running async 501 event listeners

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 24 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131 on Windows
View result in a separate tab
Test name Executions per second
running async 1000 event listeners 1.9 Ops/sec
running async 501 event listeners 0.7 Ops/sec