Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Chrome 132
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 85745888.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in a string 24024328.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in a string object 91958856.0 Ops/sec
Check if object by comparing value to an object instantiated from the value - passing in an integer 39073036.0 Ops/sec
Check if object by using instanceof - passing in an object 106306920.0 Ops/sec
Check if object by using instanceof - passing in a string 111459712.0 Ops/sec
Check if object by using instanceof - passing in a string object 103888552.0 Ops/sec
Check if object by using instanceof - passing in an integer 110433136.0 Ops/sec
Check if object by using typeof - passing in an object 111777392.0 Ops/sec
Check if object by using typeof - passing in a string 105941016.0 Ops/sec
Check if object by using typeof - passing in a string object 111329752.0 Ops/sec
Check if object by using typeof - passing in an integer 106585528.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