Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36
Chrome 103
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
class without declared fields 9461.3 Ops/sec
class with declared fields 1309.6 Ops/sec
function constructor 5555.9 Ops/sec
object literal 724909.2 Ops/sec
object literal & sum.call 86515.5 Ops/sec
object literal & sum.bind 13069.8 Ops/sec
Object.create 3101.3 Ops/sec
Object.setPrototypeOf 887.8 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