Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
instanceof vs constructor check vs field
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser:
Chrome 141
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
9 months ago
constructor
174.6M/s
field
174.2M/s
instanceof
160.3M/s
constructor.name
54.2M/s
View exact numbers
Test name
Executions per second
✓
constructor
174,615,584 Ops/sec
field
174,174,064 Ops/sec
instanceof
160,329,680 Ops/sec
constructor.name
54,220,272 Ops/sec
Script Preparation code:
var A = class A { _className = 'A' } var a = new A()
Tests:
instanceof
var b = a instanceof A
constructor
var b = a.constructor === A
field
var b = a._className === 'A'
constructor.name
var b = a.constructor.name === 'A'