|
|
@ -25,13 +25,18 @@ const benchmarks = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
async function run_benchmarks() {
|
|
|
|
async function run_benchmarks() {
|
|
|
|
|
|
|
|
let total_time = 0;
|
|
|
|
|
|
|
|
let total_gc_time = 0;
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log('-- Benchmarking Started --');
|
|
|
|
console.log('-- Benchmarking Started --');
|
|
|
|
$.push({}, true);
|
|
|
|
$.push({}, true);
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
for (const benchmark of benchmarks) {
|
|
|
|
for (const benchmark of benchmarks) {
|
|
|
|
|
|
|
|
const results = await benchmark();
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log(await benchmark());
|
|
|
|
console.log(results);
|
|
|
|
|
|
|
|
total_time += Number(results.time);
|
|
|
|
|
|
|
|
total_gc_time += Number(results.gc_time);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
@ -42,7 +47,12 @@ async function run_benchmarks() {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$.pop();
|
|
|
|
$.pop();
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log('-- Benchmarking Complete --');
|
|
|
|
console.log(`-- Benchmarking Complete --`);
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
|
|
|
|
console.log({
|
|
|
|
|
|
|
|
total_time: total_time.toFixed(2),
|
|
|
|
|
|
|
|
total_gc_time: total_gc_time.toFixed(2)
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
run_benchmarks();
|
|
|
|
run_benchmarks();
|
|
|
|