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
Trying to see how much overhead the functional iterators from ECMA5 have over doing things the old fashioned way with a for loop.
Each test case is doing a boring old sum.
Underscore uses the native version of a function if it exists, but is probably doing a few checks and falls back on other implementations.
Native functions will cause errors on browsers where they don't exist.
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.2.2/underscore-min.js">
</script>
<script>
array = [];
i = 5000;
while (i--) {
array.push(Math.floor(Math.random() * 100));
}
</script>Ready to run.
| Test | Ops/sec | |
|---|---|---|
| For Loop | | ready |
| For In | | ready |
| For In (Unprotected) | | ready |
| ForEach | | ready |
| Reduce | | ready |
| ReduceRight | | ready |
| Object.keys | | ready |
| Native ForEach | | ready |
| Native Reduce | | ready |
| Native ReduceRight | | ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.