Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
PRNG functions in plain JavaScript
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64; rv:129.0) Gecko/20100101 Firefox/129.0
Browser:
Firefox 129
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one month ago
Test name
Executions per second
sfc32 (Simple Fast Counter)
33707744.0 Ops/sec
SplitMix32
43144828.0 Ops/sec
Mulberry32
42680588.0 Ops/sec
xoshiro128**
33892964.0 Ops/sec
JSF (Jenkins' Small Fast)
35356064.0 Ops/sec
standart
336084704.0 Ops/sec
Script Preparation code:
var a = 1; var b = 2; var c = 3; var d = 4; var x; function sfc32(a, b, c, d) { return function() { a |= 0; b |= 0; c |= 0; d |= 0; let t = (a + b | 0) + d | 0; d = d + 1 | 0; a = b ^ b >>> 9; b = c + (c << 3) | 0; c = (c << 21 | c >>> 11); c = c + t | 0; return (t >>> 0) / 4294967296; } } function splitmix32(a) { return function() { a |= 0; a = a + 0x9e3779b9 | 0; let t = a ^ a >>> 16; t = Math.imul(t, 0x21f0aaad); t = t ^ t >>> 15; t = Math.imul(t, 0x735a2d97); return ((t = t ^ t >>> 15) >>> 0) / 4294967296; } } function mulberry32(a) { return function() { let t = a += 0x6D2B79F5; t = Math.imul(t ^ t >>> 15, t | 1); t ^= t + Math.imul(t ^ t >>> 7, t | 61); return ((t ^ t >>> 14) >>> 0) / 4294967296; } } function xoshiro128ss(a, b, c, d) { return function() { let t = b << 9, r = b * 5; r = (r << 7 | r >>> 25) * 9; c ^= a; d ^= b; b ^= c; a ^= d; c ^= t; d = d << 11 | d >>> 21; return (r >>> 0) / 4294967296; } } function jsf32(a, b, c, d) { return function() { a |= 0; b |= 0; c |= 0; d |= 0; let t = a - (b << 27 | b >>> 5) | 0; a = b ^ (c << 17 | c >>> 15); b = c + d | 0; c = d + t | 0; d = a + t | 0; return (d >>> 0) / 4294967296; } }
Tests:
sfc32 (Simple Fast Counter)
x = sfc32(a, b, c, d);
SplitMix32
x = splitmix32(a);
Mulberry32
x = mulberry32(a);
xoshiro128**
x = xoshiro128ss(a, b, c, d);
JSF (Jenkins' Small Fast)
x = jsf32(a, b, c, d);
standart
x = Math.random();