Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Chrome 121
Mac OS X 10.15.7
Desktop
2 years ago
Unary + (with NaN)
170.9M/s
Number (with NaN)
15.4M/s
parseInt (with NaN)
15.4M/s
Unary + (with float)
14.7M/s
Unary + (with integer)
7.9M/s
Number (with float)
7.8M/s
parseInt (with float)
7.5M/s
Unary + (with string integer)
7.5M/s
Number (with integer)
5.4M/s
parseInt (with integer)
5.3M/s
parseInt (with string integer)
5.2M/s
Number (with string integer)
5.2M/s
Unary + (with string float)
3.8M/s
parseInt (with string float)
3.8M/s
Number (with string float)
3.1M/s
View exact numbers
Test name Executions per second
Unary + (with NaN) 170,938,800 Ops/sec
Number (with NaN) 15,403,207 Ops/sec
parseInt (with NaN) 15,394,857 Ops/sec
Unary + (with float) 14,679,106 Ops/sec
Unary + (with integer) 7,932,063 Ops/sec
Number (with float) 7,846,660 Ops/sec
parseInt (with float) 7,526,770 Ops/sec
Unary + (with string integer) 7,504,464 Ops/sec
Number (with integer) 5,446,434 Ops/sec
parseInt (with integer) 5,331,914 Ops/sec
parseInt (with string integer) 5,245,568 Ops/sec
Number (with string integer) 5,188,144 Ops/sec
Unary + (with string float) 3,841,696 Ops/sec
parseInt (with string float) 3,814,571 Ops/sec
Number (with string float) 3,097,999 Ops/sec
Tests: