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
Underscore's extend() and defaults() functions can be used to achieve a similar result, by reversing the arguments. The object that is modified will be the first argument passed to either function, but the final value of the first argument will be the same in either case.
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>
var foo = {
a: 1,
b: 2,
c: 3,
d: 4,
e: 5
};
var bar = {
b: 1,
c: 2,
d: 3,
e: 4,
f: 5
};
var baz = {
c: 1,
d: 2,
e: 3,
f: 4,
g: 5
};
Ready to run.
Test | Ops/sec | |
---|---|---|
extend() |
| ready |
defaults() |
| ready |
extend() 2 |
| ready |
defaults() 2 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.