Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36
Chrome 136
Mac OS X 10.15.7
Desktop
one year ago
constructor comparison (null)
280.5M/s
then check (promise)
269.6M/s
then check (null)
266.2M/s
constructor comparison (promise)
264.3M/s
constructor comparison (empty object)
259.4M/s
then check (empty object)
258.8M/s
instanceof Promise (null)
257.5M/s
instanceof Promise (promise)
256.1M/s
instanceof Promise (empty object)
189.9M/s
View exact numbers
Test name Executions per second
constructor comparison (null) 280,459,456 Ops/sec
then check (promise) 269,572,288 Ops/sec
then check (null) 266,195,408 Ops/sec
constructor comparison (promise) 264,300,256 Ops/sec
constructor comparison (empty object) 259,397,024 Ops/sec
then check (empty object) 258,836,464 Ops/sec
instanceof Promise (null) 257,510,560 Ops/sec
instanceof Promise (promise) 256,106,400 Ops/sec
instanceof Promise (empty object) 189,937,472 Ops/sec
Script Preparation code:
Tests: