Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Mac OS X 10.15.7
Desktop
2 months ago
Test name Executions per second
Check if object by comparing value to an object instantiated from the value - passing in an object 85065192.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in a string 23683478.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in a string object 87515440.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in an integer 32428818.0 Ops/sec
Check if object by using instanceof - passing in an object 111343112.0 Ops/sec
Check if object by using instanceof - passing in a string 128180232.0 Ops/sec
Check if object by using instanceof - passing in a string object 109949168.0 Ops/sec
Check if object by using instanceof - passing in an integer 135158704.0 Ops/sec
Check if object by using typeof - passing in an object 134372272.0 Ops/sec
Check if object by using typeof - passing in a string 119427768.0 Ops/sec
Check if object by using typeof - passing in a string object 138662704.0 Ops/sec
Check if object by using typeof - passing in an integer 131702312.0 Ops/sec
Script Preparation code:
Tests:
  • Check if object by comparing value to an object instantiated from the value - passing in an object

  • Check if object by comparing value to an object instantiated from the value - passing in a string

  • Check if object by comparing value to an object instantiated from the value - passing in a string object

  • Check if object by comparing value to an object instantiated from the value - passing in an integer

  • Check if object by using instanceof - passing in an object

  • Check if object by using instanceof - passing in a string

  • Check if object by using instanceof - passing in a string object

  • Check if object by using instanceof - passing in an integer

  • Check if object by using typeof - passing in an object

  • Check if object by using typeof - passing in a string

  • Check if object by using typeof - passing in a string object

  • Check if object by using typeof - passing in an integer