Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Linux
Desktop
2 years ago
Test name Executions per second
class without declared fields 2164.7 Ops/sec
class with declared fields 365.6 Ops/sec
function constructor 1420.7 Ops/sec
object literal 196115.7 Ops/sec
object literal & sum.call 198147.3 Ops/sec
object literal & sum.bind 11087.1 Ops/sec
Object.create 697.2 Ops/sec
Object.setPrototypeOf 207.3 Ops/sec
Script Preparation code:
Tests:
  • class without declared fields

  • class with declared fields

  • function constructor

  • object literal

  • object literal & sum.call

  • object literal & sum.bind

  • Object.create

  • Object.setPrototypeOf