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
then check (promise)
284.5M/s
instanceof Promise (null)
283.7M/s
instanceof Promise (promise)
283.4M/s
type obj?.then === function (promise)
276.0M/s
type obj?.then === function (null)
271.4M/s
constructor comparison (null)
270.0M/s
then check (null)
268.4M/s
constructor comparison (promise)
268.2M/s
type obj?.then === function (empty object)
258.3M/s
then check (empty object)
255.5M/s
constructor comparison (empty object)
254.5M/s
instanceof Promise (empty object)
192.0M/s
View exact numbers
Test name Executions per second
then check (promise) 284,511,104 Ops/sec
instanceof Promise (null) 283,734,208 Ops/sec
instanceof Promise (promise) 283,437,664 Ops/sec
type obj?.then === function (promise) 276,022,752 Ops/sec
type obj?.then === function (null) 271,441,504 Ops/sec
constructor comparison (null) 270,014,592 Ops/sec
then check (null) 268,432,352 Ops/sec
constructor comparison (promise) 268,223,152 Ops/sec
type obj?.then === function (empty object) 258,256,720 Ops/sec
then check (empty object) 255,511,488 Ops/sec
constructor comparison (empty object) 254,500,176 Ops/sec
instanceof Promise (empty object) 191,984,272 Ops/sec
Script Preparation code:
Tests: