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; rv:147.0) Gecko/20100101 Firefox/147.0
Browser:
Firefox 147
Operating system:
Windows
Device Platform:
Desktop
Date tested:
3 months ago
Test name
Executions per second
Array Sort
153.4 Ops/sec
TypedArray Sort
330.7 Ops/sec
Array Sort Custom Comparer
297.5 Ops/sec
TypedArray Sort Custom Comparer
214.5 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);