Script Preparation code:
AخA
 
const minimum = 1
const maximum = 1000
var arr = Array.from({ length: 1000000 }, () => Math.floor(Math.random() * (maximum - minimum + 1)) + minimum)
Tests:
  • Number

     
    return arr.map((el) => Number(el))
  • parseInt

     
    return arr.map((el) => parseInt(el))
  • >>0

     
    return arr.map((el) => el >> 0)
  • *1

     
    return arr.map((el) => el * 1)
  • ~~

     
    return arr.map((el) => ~~el)
  • +

     
    return arr.map((el) => +el)
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    Number
    parseInt
    >>0
    *1
    ~~
    +

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: yesterday)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0
Firefox 138 on Windows
View result in a separate tab
Test name Executions per second
Number 80.5 Ops/sec
parseInt 114.3 Ops/sec
>>0 149.4 Ops/sec
*1 148.0 Ops/sec
~~ 146.6 Ops/sec
+ 144.8 Ops/sec