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
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.21/lodash.min.js" integrity="sha512-WFN04846sdKMIP5LKNphMaWzU7YpMyCU245etK3g/2ARYbPK9Ub18eG+ljU96qKRCWh+quCY7yefSmlkQw1ANQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
const baseAttributes = { a: 1, b: 2, c: 3 };
const utmParams = { d: 4, e: 5 };
const rest = { f: 6 };
const extension = { g: 7 };
const eventTimestamp = { h: 8 };
// 병합할 객체 리스트
const testData = [baseAttributes, utmParams, rest, extension, eventTimestamp];
// 사용자 정의 Shallow Merge 함수
function mergeAttributes(target, ...sources) {
for (const source of sources) {
if (source) {
for (const key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
}
return target;
}
Ready to run.
Test | Ops/sec | |
---|---|---|
사용자 정의 mergeAttributes |
| ready |
Lodash _.merge() |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.