Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Array VS. TypedArray Sort 2
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0
Browser:
Chrome 129
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
Array Sort
707.3 Ops/sec
TypedArray Sort
17404.3 Ops/sec
Array Sort Custom Comparer
957.1 Ops/sec
TypedArray Sort Custom Comparer
166.9 Ops/sec
Script Preparation code:
var length = 100000; var a= new Array(length); var ta = new Int32Array(length); var a2= new Array(length); var ta2 = new Int32Array(length); for(let i=0;i<length;i++){ let num = Math.floor(Math.random()*100000); a[i]=num; ta[i]=num; a2[i]=num; ta2[i]=num; }
Tests:
Array Sort
a.sort();
TypedArray Sort
ta.sort();
Array Sort Custom Comparer
a2.sort((a,b)=>a-b);
TypedArray Sort Custom Comparer
ta2.sort((a,b)=>a-b);