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: 18 days ago)
Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Chrome 134 on Android
View result in a separate tab
Test name Executions per second
Number 51.2 Ops/sec
parseInt 63.6 Ops/sec
>>0 63.9 Ops/sec
*1 62.6 Ops/sec
~~ 64.2 Ops/sec
+ 64.4 Ops/sec