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)
290.5M/s
then in (promise)
277.0M/s
constructor comparison (promise)
274.7M/s
instanceof Promise (promise)
274.4M/s
then check (promise)
272.0M/s
then in (null)
269.4M/s
constructor comparison (empty object)
268.1M/s
type obj?.then === function (null)
264.5M/s
type obj?.then === function (promise)
264.1M/s
instanceof Promise (null)
261.3M/s
then check (null)
257.8M/s
type obj?.then === function (empty object)
251.9M/s
then check (empty object)
249.0M/s
instanceof Promise (empty object)
241.8M/s
then in (empty object)
231.4M/s
View exact numbers
Test name Executions per second
constructor comparison (null) 290,545,728 Ops/sec
then in (promise) 277,024,768 Ops/sec
constructor comparison (promise) 274,690,304 Ops/sec
instanceof Promise (promise) 274,353,824 Ops/sec
then check (promise) 272,032,704 Ops/sec
then in (null) 269,355,904 Ops/sec
constructor comparison (empty object) 268,097,376 Ops/sec
type obj?.then === function (null) 264,524,080 Ops/sec
type obj?.then === function (promise) 264,084,512 Ops/sec
instanceof Promise (null) 261,321,632 Ops/sec
then check (null) 257,841,136 Ops/sec
type obj?.then === function (empty object) 251,857,760 Ops/sec
then check (empty object) 248,983,088 Ops/sec
instanceof Promise (empty object) 241,844,304 Ops/sec
then in (empty object) 231,402,128 Ops/sec
Script Preparation code:
Tests: