Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
large string comparison
Worst case large string comparison.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36
Browser:
Chrome 122
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
1MB string comparison
97708.5 Ops/sec
2MB string comparison
12462.0 Ops/sec
10MB string comparison
783.1 Ops/sec
Script Preparation code:
let s1MB = "0123456789".repeat(1000*100); var strings1MB = Array.from(Array(20)).map(o=>s1MB + String.fromCharCode(32+~~(Math.random()*96))) let s2MB = "0123456789".repeat(1000*200); var strings2MB = Array.from(Array(20)).map(o=>s2MB + String.fromCharCode(32+~~(Math.random()*96))) let s10MB = "0123456789".repeat(1000*1000); var strings10MB = Array.from(Array(20)).map(o=>s10MB + String.fromCharCode(32+~~(Math.random()*96)))
Tests:
1MB string comparison
const s1 = strings1MB[~~(strings1MB.length*Math.random())]; const s2 = strings1MB[~~(strings1MB.length*Math.random())]; const b = s1 === s2;
2MB string comparison
const s1 = strings2MB[~~(strings2MB.length*Math.random())]; const s2 = strings2MB[~~(strings2MB.length*Math.random())]; const b = s1 === s2;
10MB string comparison
const s1 = strings10MB[~~(strings10MB.length*Math.random())]; const s2 = strings10MB[~~(strings10MB.length*Math.random())]; const b = s1 === s2;