Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36
Chrome 105
Linux
Desktop
2 years ago
Test name Executions per second
class without declared fields 2177.3 Ops/sec
class with declared fields 331.2 Ops/sec
function constructor 1465.5 Ops/sec
object literal 196456.4 Ops/sec
object literal & sum.call 197749.9 Ops/sec
object literal & sum.bind 11198.2 Ops/sec
Object.create 769.4 Ops/sec
Object.setPrototypeOf 203.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