Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36
Chrome 119
Windows
Desktop
one year ago
Test name Executions per second
class without declared fields 22111.8 Ops/sec
class with declared fields 2854.2 Ops/sec
function constructor 22230.4 Ops/sec
object literal 1354275.4 Ops/sec
object literal & sum.call 1371078.0 Ops/sec
object literal & sum.bind 111225.1 Ops/sec
Object.create 7998.8 Ops/sec
Object.setPrototypeOf 1675.2 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