Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36
Chrome 100
Windows
Desktop
2 years ago
Test name Executions per second
class without declared fields 27264.5 Ops/sec
class with declared fields 4042.4 Ops/sec
function constructor 16792.3 Ops/sec
object literal 1749000.9 Ops/sec
object literal & sum.call 553631.4 Ops/sec
object literal & sum.bind 133798.2 Ops/sec
Object.create 8923.0 Ops/sec
Object.setPrototypeOf 1901.5 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