Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36
Chrome 92
Windows
Desktop
3 years ago
Test name Executions per second
Number (with string integer) 1168449.0 Ops/sec
Unary + (with string integer) 1446013.9 Ops/sec
parseInt (with string integer) 1073095.0 Ops/sec
Number (with string float) 581010.4 Ops/sec
Unary + (with string float) 890738.6 Ops/sec
parseInt (with string float) 802123.6 Ops/sec
Number (with integer) 1245875.8 Ops/sec
Unary + (with integer) 1787419.6 Ops/sec
parseInt (with integer) 1213403.9 Ops/sec
Number (with float) 1811846.1 Ops/sec
Unary + (with float) 3354004.2 Ops/sec
parseInt (with float) 1766056.4 Ops/sec
Number (with NaN) 4037942.2 Ops/sec
Unary + (with NaN) 714488640.0 Ops/sec
parseInt (with NaN) 2777648.5 Ops/sec
Tests:
  • Number (with string integer)

  • Unary + (with string integer)

  • parseInt (with string integer)

  • Number (with string float)

  • Unary + (with string float)

  • parseInt (with string float)

  • Number (with integer)

  • Unary + (with integer)

  • parseInt (with integer)

  • Number (with float)

  • Unary + (with float)

  • parseInt (with float)

  • Number (with NaN)

  • Unary + (with NaN)

  • parseInt (with NaN)


;