Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Dynamic class vs object
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser:
Chrome 130
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
static class
4.0M/s
object
3.7M/s
dynamic class
527K/s
View exact numbers
Test name
Executions per second
✓
static class
3,967,411 Ops/sec
object
3,701,650 Ops/sec
dynamic class
527,025 Ops/sec
Script Preparation code:
function newObj() { return {aaa: 42, bbb: "hello"} } function newClass() { return new class { aaa = 42 bbb = "hello" } } class StaticClass { aaa = 42 bbb = "hello" } window.StaticClass = StaticClass
Tests:
dynamic class
let obj = newClass() window.aaa = obj.aaa window.bbb = obj.bbb
object
let obj = newObj() window.aaa = obj.aaa window.bbb = obj.bbb
static class
let obj = new StaticClass() window.aaa = obj.aaa window.bbb = obj.bbb