Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
Chrome 120
Windows
Desktop
11 months ago
Test name Executions per second
class without declared fields 26956.4 Ops/sec
class with declared fields 4058.5 Ops/sec
function constructor 26410.6 Ops/sec
object literal 1941801.1 Ops/sec
object literal & sum.call 1941421.5 Ops/sec
object literal & sum.bind 127970.3 Ops/sec
Object.create 9854.8 Ops/sec
Object.setPrototypeOf 2259.6 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