Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
testing
(version: 0)
test
Comparing performance of:
1st vs 2nd vs 3rd vs 4th
Created:
8 years ago
by:
Guest
Jump to the latest result
Tests:
1st
var i = "HDMU987481" var a = 0; var x = i.charCodeAt(0)-55; var y = i.charCodeAt(1)-55; var z = i.charCodeAt(2)-55; var w = i.charCodeAt(3)-55; a+=Math.floor(x>>3.35)+x; a+=(Math.floor(y>>3.35)+y)<<1; a+=(Math.floor(z>>3.35)+z)<<2; a+=(Math.floor(w>>3.35)+w)<<3; a+=(i.charCodeAt(4)-48)<<4; a+=(i.charCodeAt(5)-48)<<5; a+=(i.charCodeAt(6)-48)<<6; a+=(i.charCodeAt(7)-48)<<7; a+=(i.charCodeAt(8)-48)<<8; a+=(i.charCodeAt(9)-48)<<9; var b = a % 11 % 10; return b
2nd
var i = "HDMU987481" var a = 0; var x = i.charCodeAt(0)-55; var y = i.charCodeAt(1)-55; var z = i.charCodeAt(2)-55; var w = i.charCodeAt(3)-55; a+=Math.floor(x>>3.35)+x; a+=(Math.floor(y>>3.35)+y)*2; a+=(Math.floor(z>>3.35)+z)*4; a+=(Math.floor(w>>3.35)+w)*8; a+=i.charCodeAt(4)*16-768; a+=i.charCodeAt(5)*32-1536; a+=i.charCodeAt(6)*64-3072; a+=i.charCodeAt(7)*128-6144; a+=i.charCodeAt(8)*256-12288; a+=i.charCodeAt(9)*512-24576; var b = a % 11 % 10; return b
3rd
var i = "HDMU987481" var a = 0; var x = i.charCodeAt(0)-55; var y = i.charCodeAt(1)-55; var z = i.charCodeAt(2)-55; var w = i.charCodeAt(3)-55; a+=((x>>3.35)+x)>>0; a+=(((y>>3.35)+y)>>0)<<1; a+=(((z>>3.35)+z)>>0)<<2; a+=(((w>>3.35)+w)>>0)<<3; a+=(i.charCodeAt(4)-48)<<4; a+=(i.charCodeAt(5)-48)<<5; a+=(i.charCodeAt(6)-48)<<6; a+=(i.charCodeAt(7)-48)<<7; a+=(i.charCodeAt(8)-48)<<8; a+=(i.charCodeAt(9)-48)<<9; var b = a % 11 % 10; return b
4th
var i = "HDMU987481" var a = 0; var x = i.charCodeAt(0)-55; var y = i.charCodeAt(1)-55; var z = i.charCodeAt(2)-55; var w = i.charCodeAt(3)-55; a+=(x>>3.35)+x>>0; a+=(y>>3.35)+y>>0<<1; a+=(z>>3.35)+z>>0<<2; a+=(w>>3.35)+w>>0<<3; a+=(i.charCodeAt(4)<<4)-768; a+=(i.charCodeAt(5)<<5)-1536; a+=(i.charCodeAt(6)<<6)-3072; a+=(i.charCodeAt(7)<<7)-6144; a+=(i.charCodeAt(8)<<8)-12288; a+=(i.charCodeAt(9)<<9)-24576; var b = a % 11 % 10; return b
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (4)
Previous results
Fork
Test case name
Result
1st
2nd
3rd
4th
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):
**What is tested on the provided JSON?** The provided JSON represents a JavaScript microbenchmark test case. The benchmark tests the performance of different mathematical operations and bitwise shifts performed on a specific Unicode string. **Options compared:** There are four benchmark definitions being compared, each with slightly different implementations: 1. **Option 1 (1st)**: * Shifts `x`, `y`, `z`, and `w` by `3.35` bits. * Adds the shifted values to `a`. * Multiplies the result by powers of 2 (e.g., `(y>>3.35)+y<<1`). 2. **Option 2 (2nd)**: * Shifts `x`, `y`, `z`, and `w` by `3.35` bits. * Adds the shifted values to `a`. * Multiplies the result by powers of 2 (e.g., `(y>>3.35)+y*2`). 3. **Option 3 (3rd)**: * Shifts `x`, `y`, `z`, and `w` by `3.35` bits. * Adds the shifted values to `a`. * Shifts the result of each multiplication by powers of 0 ( effectively casting to integer). 4. **Option 4 (4th)**: * Shifts `x`, `y`, `z`, and `w` by `3.35` bits. * Adds the shifted values to `a`. * Multiplies the result by powers of 16, then subtracts constants. **Pros and cons:** Each option has its strengths and weaknesses: 1. **Option 1 (1st)**: * Pros: Simple, easy to understand, and might be faster due to fewer multiplications. * Cons: May suffer from "over-shift" issues if the shifted values exceed the maximum value that can be represented by an integer. 2. **Option 2 (2nd)**: * Pros: Can avoid over-shift issues, as multiplying by powers of 2 is generally faster and more efficient. * Cons: Requires careful optimization to avoid unnecessary multiplications. 3. **Option 3 (3rd)**: * Pros: Shifts the result of each multiplication by powers of 0, which can be beneficial for performance-critical code. * Cons: May require additional casting operations or compiler optimizations to ensure correct results. 4. **Option 4 (4th)**: * Pros: Can potentially avoid over-shift issues and take advantage of hardware optimizations for multiplication and subtraction. * Cons: Requires careful optimization to balance the trade-off between performance and code complexity. **Latest benchmark result:** The latest benchmark result shows that: * Option 1 (1st) is the slowest, with a low number of executions per second. * Option 3 (3rd) is slightly faster than Option 2 (2nd), but still slower than Option 4 (4th). * Options 2 and 4 are generally comparable in terms of performance. **Note:** The actual performance difference between these options may vary depending on the specific hardware, compiler, and JavaScript engine being used.
Related benchmarks:
more vs not equal
test of equals
!= vs >= war
Comparison benchmark <= vs < vs ==
ehandling
Comments
Confirm delete:
Do you really want to delete benchmark?