Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36
Chrome 114
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
class without declared fields 23490.6 Ops/sec
class with declared fields 4228.6 Ops/sec
function constructor 24069.4 Ops/sec
object literal 1254008.5 Ops/sec
object literal & sum.call 1253999.2 Ops/sec
object literal & sum.bind 111323.9 Ops/sec
Object.create 9296.9 Ops/sec
Object.setPrototypeOf 1797.7 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