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
Who's faster to delete an element from an array, underscore's without method or implementation of Array remove method ?
<script src="//underscorejs.org/underscore-min.js"></script>var arr = _.range(10000);
var arr2 = _.range(10000);
var i = 0;
var j = 0;
Array.prototype.remove = function (needle) {
var i = 0;
while (this[i] !== needle && i < this.length - 1) ++i;
if (this[i] === needle) {
this.splice(i, 1);
}
else {
throw new Error(needle + " not found in array " + this);
}
};Ready to run.
| Test | Ops/sec | |
|---|---|---|
| _.without | | ready |
| Array.prototype.remove | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.