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
instanceof Promise (null)
299.5M/s
constructor comparison (promise)
282.2M/s
instanceof Promise (promise)
279.1M/s
then check (promise)
270.5M/s
constructor comparison (empty object)
260.9M/s
then check (null)
259.4M/s
then check (empty object)
259.3M/s
constructor comparison (null)
256.3M/s
instanceof Promise (empty object)
234.5M/s
View exact numbers
Test name Executions per second
instanceof Promise (null) 299,509,888 Ops/sec
constructor comparison (promise) 282,240,416 Ops/sec
instanceof Promise (promise) 279,110,336 Ops/sec
then check (promise) 270,533,824 Ops/sec
constructor comparison (empty object) 260,892,112 Ops/sec
then check (null) 259,379,056 Ops/sec
then check (empty object) 259,324,480 Ops/sec
constructor comparison (null) 256,342,560 Ops/sec
instanceof Promise (empty object) 234,459,168 Ops/sec
Script Preparation code:
Tests: