Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.5 Safari/605.1.15
Safari 15
Mac OS X 10.15.7
Desktop
2 years ago
Test name Executions per second
class without declared fields 17815.4 Ops/sec
class with declared fields 19317.1 Ops/sec
function constructor 18505.1 Ops/sec
object literal 648701.6 Ops/sec
object literal & sum.call 685796.9 Ops/sec
object literal & sum.bind 13902.6 Ops/sec
Object.create 2218.0 Ops/sec
Object.setPrototypeOf 1520.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