Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:133.0) Gecko/20100101 Firefox/133.0
Firefox 133
Ubuntu
Desktop
one year ago
Benchmark.js
typeof -> function
5.8M/s
Object.prototype.toString.call -> string
2.6M/s
Object.prototype.toString.call -> function
2.4M/s
Object.prototype.toString.call -> boolean
2.2M/s
Object.prototype.toString.call -> object
2.0M/s
View exact numbers
| Test name |
Executions per second |
|
✓
typeof -> string
|
13,308,329 Ops/sec |
|
typeof -> boolean
|
7,101,557 Ops/sec |
|
typeof -> object
|
6,138,431 Ops/sec |
|
typeof -> function
|
5,764,052 Ops/sec |
|
Object.prototype.toString.call -> string
|
2,643,098 Ops/sec |
|
Object.prototype.toString.call -> function
|
2,430,284 Ops/sec |
|
Object.prototype.toString.call -> boolean
|
2,222,140 Ops/sec |
|
Object.prototype.toString.call -> object
|
1,961,103 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