Script Preparation code:
AخA
 
var a = [
    'height',
    'width',
    'maxHeight',
    'maxWidth',
    'maxHeight',
    'minWidth',
    'color',
    'bg',
    'backgroundColor',
    'opacity',
    'm',
    'mt',
    'mb',
    'mr',
    'mr',
    'mx',
    'my',
    'p',
    'pt',
    'pb',
    'pr',
    'pl',
    'px',
    'py',
    'border',
    'boxShadow',
    'flex',
    'verticalAlign',
    'textAlign',
    'overflow',
    'display',
    'cursor'
];
var b = new Set(a)
Tests:
  • arr.includes

     
    return a.includes(a[Math.floor(Math.random() * a.length)])
  • set.has

     
    return b.has(a[Math.floor(Math.random() * a.length)])
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    arr.includes
    set.has

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119 on Windows
View result in a separate tab
Test name Executions per second
arr.includes 4093985.2 Ops/sec
set.has 4125132.8 Ops/sec