Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Mac OS X 10.15.7
Desktop
2 years ago
Unary + (with NaN)
1043.8M/s
Number (with NaN)
18.4M/s
parseInt (with NaN)
18.4M/s
Unary + (with float)
16.9M/s
Number (with float)
8.8M/s
Unary + (with integer)
8.8M/s
parseInt (with float)
8.7M/s
Unary + (with string integer)
8.4M/s
Number (with integer)
6.0M/s
parseInt (with integer)
5.9M/s
parseInt (with string integer)
5.8M/s
Number (with string integer)
5.8M/s
Unary + (with string float)
4.5M/s
parseInt (with string float)
4.4M/s
Number (with string float)
3.6M/s
View exact numbers
Test name Executions per second
Unary + (with NaN) 1,043,805,248 Ops/sec
Number (with NaN) 18,414,456 Ops/sec
parseInt (with NaN) 18,365,136 Ops/sec
Unary + (with float) 16,946,990 Ops/sec
Number (with float) 8,826,579 Ops/sec
Unary + (with integer) 8,795,201 Ops/sec
parseInt (with float) 8,654,773 Ops/sec
Unary + (with string integer) 8,420,473 Ops/sec
Number (with integer) 5,961,756 Ops/sec
parseInt (with integer) 5,912,752 Ops/sec
parseInt (with string integer) 5,793,470 Ops/sec
Number (with string integer) 5,760,870 Ops/sec
Unary + (with string float) 4,456,382 Ops/sec
parseInt (with string float) 4,354,956 Ops/sec
Number (with string float) 3,575,084 Ops/sec
Tests: