Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
property accessing
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/140.0.0.0 Safari/537.36
Browser:
Chrome 140
Operating system:
Windows
Device Platform:
Desktop
Date tested:
10 months ago
class
9.8M/s
object
9.7M/s
prototype
9.6M/s
View exact numbers
Test name
Executions per second
✓
class
9,791,021 Ops/sec
object
9,658,760 Ops/sec
prototype
9,569,247 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function Egg_Prototype() { this.rotate = 0 } Egg_Prototype.prototype.roll = function() { this.rotate = 180 } function rollEgg() { this.rotate = 180 } function create_egg() { return { rotate: 0, roll: rollEgg } } class Egg { rotate = 0 roll() { this.rotate = 180 } } var output = document.body.appendChild(document.createElement('output'))
Tests:
prototype
var egg = new Egg_Prototype() var r1 = egg.rotate egg.roll() var r2 = egg.rotate output.textContent = r1 + r2
object
var egg = create_egg() var r1 = egg.rotate egg.roll() var r2 = egg.rotate output.textContent = r1 + r2
class
var egg = new Egg() var r1 = egg.rotate egg.roll() var r2 = egg.rotate output.textContent = r1 + r2