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 iter_zip() { var i, j, len, result, lists
lists = [].slice.call(arguments)
len = lists.length
result = []
for (i = 0; i < len; ++i) {
result[i] = []
for (j = 0; j < len; ++j) result[i].push(lists[j][i]) }
return result
}
function zip(list) { var others
others = [].slice.call(arguments, 1)
return list.reduce(function(result, value, idx) { var values
values = others.map(function(list){ return list[idx] })
values.unshift(value)
result.push(values)
return result }, [])
}
var arr1 = ['a','b','c','d','e','f']
, arr2 = [ 1, 2, 3, 4, 5, 6 ]
, arr3 = ['foo', 'bar', 'baz', 'foobar']
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
iterative zip |
| ready |
functional zip |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.