Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
asdfasdfiuasgubasb[iunab[vn
(version: 1)
Comparing performance of:
instanceof vs typeof
Created:
one year ago
by:
Guest
Go to the latest result
Script Preparation code:
class Foo { constructor() { this.isStatic = true; } } class Bar extends Foo { constructor() { super(); this.isStatic = false; } } const bar = new Bar();
Tests:
instanceof
Boolean(bar instanceof Bar)
typeof
Boolean(bar.isStatic)
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
instanceof
typeof
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
Browser/OS:
Chrome 135 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
typeof
165.0M/s
instanceof
152.2M/s
View exact numbers
Test name
Executions per second
✓
typeof
165,024,640 Ops/sec
instanceof
152,234,752 Ops/sec
Related benchmarks
instanceof vs manual checking
class declaration vs class expression 2
Comments
Confirm delete:
Do you really want to delete benchmark?