Run details:
Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/115.0
Firefox 115
Linux
Desktop
2 years ago
Benchmark.js
typeof -> function
9.3M/s
Object.prototype.toString.call -> function
1.5M/s
Object.prototype.toString.call -> boolean
1.3M/s
Object.prototype.toString.call -> object
1.3M/s
Object.prototype.toString.call -> string
1.3M/s
View exact numbers
| Test name |
Executions per second |
|
✓
typeof -> string
|
11,241,123 Ops/sec |
|
typeof -> function
|
9,316,022 Ops/sec |
|
typeof -> boolean
|
6,973,045 Ops/sec |
|
typeof -> object
|
6,621,990 Ops/sec |
|
Object.prototype.toString.call -> function
|
1,454,491 Ops/sec |
|
Object.prototype.toString.call -> boolean
|
1,302,055 Ops/sec |
|
Object.prototype.toString.call -> object
|
1,284,446 Ops/sec |
|
Object.prototype.toString.call -> string
|
1,268,119 Ops/sec |
Tests:
-
typeof -> string
-
Object.prototype.toString.call -> string
-
typeof -> boolean
-
Object.prototype.toString.call -> boolean
-
typeof -> object
-
Object.prototype.toString.call -> object
-
typeof -> function
-
Object.prototype.toString.call -> function