jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
<script>
function partition(array, begin, end, pivot)
{
var piv=array[pivot];
swap(array, pivot, end-1);
var store=begin;
var ix;
for(ix=begin; ix<end-1; ++ix) {
if(array[ix]<=piv) {
swap(array,store, ix);
++store;
}
}
swap(array,end-1, store);
return store;
}
function swap(arr, a, b, c){
c=arr[a];
arr[a]=arr[b]
arr[b]=c;
}
function qsort(array, begin, end)
{
if(end-1>begin) {
var pivot=begin+Math.floor(Math.random()*(end-begin));
pivot=partition(array, begin, end, pivot);
qsort(array, begin, pivot);
qsort(array, pivot+1, end);
}
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
native |
| ready |
qsort |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.