HTML Preparation code:
AخA
 
1
<div id="a"></div>
Script Preparation code:
 
let code = `${JSON.stringify(Array.from({length:300},(a,i)=>i))}.reduce((a,b)=>a+b)`,
    Eval = eval
Tests:
  • eval

     
    eval(code)
  • indirect eval

     
    Eval(code)
  • Function()

     
    Function(code)()
  • ^on.+$

     
    a.setAttribute('onclick', code)
    a.click()
  • setTimeout

     
    setTimeout(code)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    eval
    indirect eval
    Function()
    ^on.+$
    setTimeout

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 days ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Linux
View result in a separate tab
Test name Executions per second
eval 2214062.8 Ops/sec
indirect eval 1995268.1 Ops/sec
Function() 865034.6 Ops/sec
^on.+$ 18710.5 Ops/sec
setTimeout 698108.2 Ops/sec