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
Correct version of wierd test...
<script src="//cdn.jsdelivr.net/lodash/2.4.1/lodash.underscore.min.js"></script>
<script>
var ld = _.noConflict();
</script>
<script src="//cdn.jsdelivr.net/underscorejs/1.5.2/underscore-min.js"></script>
<script>
var us = _.noConflict();
</script>
var getRandomArrayNative = function(from, to, number) {
var result = [],
r = 0;
for (var i = 0; i < number; i++) {
do {
r = Math.floor(Math.random() * (to - from + 1) + from);
} while (result.indexOf(r) !== -1)
result.push(r);
}
return result;
};
var getRandomArrayLodash = function(number) {
var result = ld.shuffle(a);
return result.splice(0, number - 1);
};
var getRandomArrayUnderscore = function(number) {
var result = us.shuffle(a);
return result.splice(0, number - 1);
};
Ready to run.
Test | Ops/sec | |
---|---|---|
Native Random |
| ready |
Lodash Random |
| ready |
Underscore Random |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.