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)
286.7M/s
then check (promise)
285.8M/s
type obj?.then === function (promise)
284.9M/s
then in (promise)
277.7M/s
then check (null)
275.1M/s
instanceof Promise (promise)
274.9M/s
type obj?.then === function (null)
272.8M/s
constructor comparison (null)
269.5M/s
constructor comparison (empty object)
268.5M/s
then check (empty object)
266.2M/s
then in (null)
265.8M/s
then in (empty object)
265.0M/s
constructor comparison (promise)
263.9M/s
type obj?.then === function (empty object)
263.8M/s
instanceof Promise (empty object)
186.7M/s
View exact numbers
Test name Executions per second
instanceof Promise (null) 286,673,728 Ops/sec
then check (promise) 285,806,976 Ops/sec
type obj?.then === function (promise) 284,939,584 Ops/sec
then in (promise) 277,699,616 Ops/sec
then check (null) 275,131,264 Ops/sec
instanceof Promise (promise) 274,890,752 Ops/sec
type obj?.then === function (null) 272,799,872 Ops/sec
constructor comparison (null) 269,453,216 Ops/sec
constructor comparison (empty object) 268,540,544 Ops/sec
then check (empty object) 266,213,328 Ops/sec
then in (null) 265,777,920 Ops/sec
then in (empty object) 264,977,792 Ops/sec
constructor comparison (promise) 263,872,736 Ops/sec
type obj?.then === function (empty object) 263,832,848 Ops/sec
instanceof Promise (empty object) 186,713,536 Ops/sec
Script Preparation code:
Tests: