Run details:
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:131.0) Gecko/20100101 Firefox/131.0
Firefox 131
Ubuntu
Desktop
2 months ago
Test name Executions per second
class without declared fields 13396.2 Ops/sec
class with declared fields 5023.1 Ops/sec
function constructor 12838.7 Ops/sec
object literal 137253.1 Ops/sec
object literal & sum.call 100731.9 Ops/sec
object literal & sum.bind 50219.6 Ops/sec
Object.create 16069.8 Ops/sec
Object.setPrototypeOf 13064.9 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