Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
private method
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/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
B
2.1M/s
A
2.1M/s
C
2.0M/s
D
1.9M/s
View exact numbers
Test name
Executions per second
✓
B
2,084,229 Ops/sec
A
2,060,564 Ops/sec
C
2,044,202 Ops/sec
D
1,914,083 Ops/sec
Script Preparation code:
var A = class A { string = 'string' test() { return this.string + 'test' } testRun() { for (let i = 0; i < 1000; i++) { this.test() } } } var PrivateTest = Symbol('PrivateTest') var B = class B { string = 'string'; [PrivateTest]() { return this.string + 'test' } testRun() { for (let i = 0; i < 1000; i++) { this[PrivateTest]() } } } function cTest(c) { return c.string + 'test' } var C = class C { string = 'string' testRun() { for (let i = 0; i < 1000; i++) { cTest(this) } } } var D = class D { string = 'string' #test() { return this.string + 'test' } testRun() { for (let i = 0; i < 1000; i++) { this.#test() } } }
Tests:
A
var a = new A() a.testRun()
B
var b = new B() b.testRun()
C
var c = new C() c.testRun()
D
var d = new D() d.testRun()