Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
xoshiro128** various implementations
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 Firefox/128.0
Browser:
Firefox 128
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Xoshiro128StarStar
862649.7 Ops/sec
Xoshiro128StarStar2
701904.4 Ops/sec
Script Preparation code:
class Xoshiro128StarStar { constructor(a, b, c, d) { this.a = a; this.b = b; this.c = c; this.d = d; } next() { const t = this.b << 9; let r = this.b * 5; r = ((r << 7) | (r >>> 25)) * 9; this.c ^= this.a; this.d ^= this.b; this.b ^= this.c; this.a ^= this.d; this.c ^= t; this.d = (this.d << 11) | (this.d >>> 21); return r >>> 0; // Ensure unsigned integer } } class Xoshiro128StarStar2 { constructor(a, b, c, d) { this.a = a; this.b = b; this.c = c; this.d = d; } next() { const s0 = this.a; const s1 = this.b; const s2 = this.c; const s3 = this.d; const x = s1 * 5; const r = (((x << 7) | (x >>> 25)) * 9) >>> 0; const t2 = s2 ^ s0; const t3 = s3 ^ s1; this.b = s1 ^ t2; this.a = s0 ^ t3; this.c = t2 ^ (s1 << 9); this.d = (t3 << 11) | (t3 >>> 21); return r; } } rngA = new Xoshiro128StarStar(3536, 4678, 2245, 778); rngB = new Xoshiro128StarStar2(3536, 4678, 2245, 778);
Tests:
Xoshiro128StarStar
for(let i = 0; i < 100; i++) { const z = rngA.next(); }
Xoshiro128StarStar2
for(let i = 0; i < 100; i++) { const z = rngB.next(); }