Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Windows
Desktop
2 years ago
Test name Executions per second
Number (with string integer) 891252.3 Ops/sec
Unary + (with string integer) 1386206.2 Ops/sec
parseInt (with string integer) 407063.1 Ops/sec
Number (with string float) 370645.9 Ops/sec
Unary + (with string float) 419801.8 Ops/sec
parseInt (with string float) 665813.9 Ops/sec
Number (with integer) 940496.6 Ops/sec
Unary + (with integer) 1391516.1 Ops/sec
parseInt (with integer) 943327.4 Ops/sec
Number (with float) 1417431.5 Ops/sec
Unary + (with float) 2690963.5 Ops/sec
parseInt (with float) 1407677.5 Ops/sec
Number (with NaN) 2796173.8 Ops/sec
Unary + (with NaN) 568661888.0 Ops/sec
parseInt (with NaN) 2157865.2 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)


;