Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object vs Class performance
Object vs Class performance
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:143.0) Gecko/20100101 Firefox/143.0
Browser:
Firefox 143
Operating system:
Linux
Device Platform:
Desktop
Date tested:
6 months ago
Test name
Executions per second
Object
177364.7 Ops/sec
Class
9273.3 Ops/sec
Script Preparation code:
V = class Variant { constructor(s, v, t) { this.s = s; this.v = v; this.t = t; } } N = 10000; s = 's'; v = 5; t = true;
Tests:
Object
for(let n = 0; n < N; n++) { const o = { s, v, t } }
Class
for(let n = 0; n < N; n++) { const o = new V(s,v,t); }