Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ES6 Class vs Object Literal 100k runs
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/135.0.7049.83 Mobile/15E148 Safari/604.1
Browser:
Chrome Mobile iOS 135
Operating system:
iOS 17.6.1
Device Platform:
Mobile
Date tested:
one year ago
Test name
Executions per second
ES6 Class
165.1 Ops/sec
Object Literal
24642.9 Ops/sec
Tests:
ES6 Class
class Point { constructor(x, y, a, b, c, d, e, f, g, h){ this.x = x; this.y = y; this.a = a; this.b = b; this.c = c; this.d = d; this.e = e; this.f = f; this.g = g; this.h = h; } } for (var i = 0; i < 100000; i++) { var p1 = new Point(10, 10, 1, 2, 3, 4, 5, 6, 7, 8); p1.x = p1.x - 1; }
Object Literal
for (var i = 0; i < 100000; i++) { var p1 = { x: 10, y: 10, a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8 }; p1.x = p1.x - 1; }