Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
dfdsfsdfsssdd
(version: 0)
Comparing performance of:
sdhiaughisedfgsdfg vs Ugh
Created:
6 years ago
by:
Guest
Jump to the latest result
Tests:
sdhiaughisedfgsdfg
function Foo() { this.level0 = 0; this.level1 = 0; this.level2 = 0; this.max = 500; } Foo.prototype.run = function() { return this._runLevel0(); } Foo.prototype._runLevel0 = function() { if (this.level0 < this.max) { this.level0 += this._runLevel1() ? 0 : 1; return true; } else { this.level0 = 0; return false; } } Foo.prototype._runLevel1 = function() { if (this.level1 < this.max) { this.level1 += this._runLevel2() ? 0 : 1; return true; } else { this.level1 = 0; return false; } } Foo.prototype._runLevel2 = function() { if (this.level3 < this.max) { this.level3 += 1; return true; } else { this.level0 = 0; return false; } } let foo = []; let instances = 1000; for (let i = 0; i < instances; i++) { foo.push(new Foo()); } console.log('Starting'); let result = true; while (result) { for (let j = 0; j < instances; j++) { result = foo[j].run(); } } console.log('Done');
Ugh
let inc = 0; let Foo = function() { let self = this; let level0 = 0; let level1 = 0; let level2 = 0; let max = 500; function run() { return runLevel0(); } function runLevel0() { if (level0 < max) { level0 += runLevel1() ? 0 : 1; return true; } else { self.level0 = 0; return false; } } function runLevel1() { if (level1 < max) { level1 += runLevel2() ? 0 : 1; return true; } else { level1 = 0; return false; } } function runLevel2() { if (level2 < max) { level2 += 1; return true; } else { level0 = 0; return false; } } return { run: run } } let foo = []; let instances = 1000; for (let i = 0; i < instances; i++) { foo.push(new Foo()); } console.log('Starting'); let result = true; while (result) { for (let j = 0; j < instances; j++) { result = foo[j].run(); } } console.log('Done');
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
sdhiaughisedfgsdfg
Ugh
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
I'll break down the benchmark and explain what's being tested, compared, and the pros and cons of different approaches. **Benchmark Overview** The benchmark is designed to test the performance of a JavaScript implementation of a recursive function with multiple levels of depth. The function has three levels: `level0`, `level1`, and `level2`. Each level increments a counter until it reaches a maximum value, then resets the counter and moves on to the next level. **Benchmark Definition** The benchmark definition is a JSON object that contains the JavaScript code for the recursive function: ```javascript function Foo() { this.level0 = 0; this.level1 = 0; this.level2 = 0; this.max = 500; function run() { return runLevel0(); } function runLevel0() { if (this.level0 < this.max) { this.level0 += this._runLevel1() ? 0 : 1; return true; } else { this.level0 = 0; return false; } } function runLevel1() { if (this.level1 < this.max) { this.level1 += this._runLevel2() ? 0 : 1; return true; } else { this.level1 = 0; return false; } } function runLevel2() { if (this.level3 < this.max) { this.level3 += 1; return true; } else { this.level0 = 0; return false; } } return { run: run }; } let foo = []; let instances = 1000; for (let i = 0; i < instances; i++) { foo.push(new Foo()); } console.log('Starting'); let result = true; while (result) { for (let j = 0; j < instances; j++) { result = foo[j].run(); } } console.log('Done'); ``` **Options Compared** The benchmark compares the performance of two different approaches: 1. ** Firefox 67**: This is the first benchmark result, which shows the execution time of the recursive function in Firefox 67. 2. **"Ugh" (unnamed)**: This is the second benchmark result, which shows the execution time of another implementation of the recursive function. **Pros and Cons** **Firefox 67** * Pros: + Optimized for performance by Mozilla's JavaScript engine + Takes advantage of Firefox's Just-In-Time (JIT) compilation * Cons: + May not be representative of other JavaScript engines or implementations **"Ugh" (unnamed)** * Pros: + Possibly more efficient due to custom implementation + May be optimized for specific use cases or performance requirements * Cons: + Unknown optimizations or improvements made by the author + May have different performance characteristics compared to Firefox 67 **Other Considerations** * **Library usage**: The benchmark does not seem to rely on any external libraries, but it's worth noting that some JavaScript engines may have built-in optimizations or features that could affect performance. * **Device platform and operating system**: The benchmark is run on a desktop device with Windows, which may impact the results. Running the benchmark on different devices or platforms could provide more representative results. Overall, this benchmark provides insight into the performance of recursive functions in JavaScript implementations, highlighting the differences between optimized engine-based implementations (like Firefox 67) and custom-built optimizations (represented by "Ugh").
Related benchmarks:
Multi attributes
Multiple Attributes
Multiple Attributes II
Multiple Attributes Performance IV
Multiple Attributes III
Comments
Confirm delete:
Do you really want to delete benchmark?