Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36
Chrome 118
Windows
Desktop
11 months ago
Test name Executions per second
class without declared fields 32803.4 Ops/sec
class with declared fields 5071.0 Ops/sec
function constructor 32516.0 Ops/sec
object literal 1985532.9 Ops/sec
object literal & sum.call 1987619.5 Ops/sec
object literal & sum.bind 159446.5 Ops/sec
Object.create 12634.3 Ops/sec
Object.setPrototypeOf 1995.4 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