Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
ES6 Class vs Prototype vs Object Literal v3
Test the speed and memory usage using 3 different techniques for constructing class objects.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.4 Safari/605.1.15
Browser:
Safari 26
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
ES6 Class
316635968.0 Ops/sec
Object Literal
299002816.0 Ops/sec
Script Preparation code:
class Point1 { constructor(x, y) { this.x = x; this.y = y; } } function Point3(x, y) { return { x, y } }
Tests:
ES6 Class
var p1 = new Point1(10, 10); var p2 = new Point1(10, -10);
Object Literal
var p1 = Point3(10, 10); var p2 = Point3(10, -10);