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
Testing a custom version of underscore extend without side effects.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<script src="http://documentcloud.github.com/underscore/underscore-min.js">
</script>
<script>
var slice = Array.prototype.slice,
customExtend = function(obj) {
copy = _.clone(obj);
_.each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
copy[prop] = source[prop];
}
});
return copy;
},
options = {
name: "Dave",
age: 26,
family: {
father: true,
mother: true
}
},
addlOptions = {
occupation: "lumberjack",
education: "phd",
children: {
daughters: ['stephanie', 'amanda'],
sons: ['william']
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
custom underscore extend |
| ready |
underscore extend |
| ready |
jquery deep extend |
| ready |
jquery extend |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.