chore: improve internal benchmarking (#13620)

* chore: improve internal benchmarking

* update type

* simplify
pull/13625/head
Dominic Gannaway 11 months ago committed by GitHub
parent 48f0bfc73f
commit 974e823b5b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -174,10 +174,13 @@ export async function sbench_create_0to1() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_0to1, COUNT, 0); bench(create_computations_0to1, COUNT, 0);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_0to1', benchmark: 'sbench_create_0to1',
@ -193,10 +196,13 @@ export async function sbench_create_1to1() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to1, COUNT, COUNT); bench(create_computations_1to1, COUNT, COUNT);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1to1', benchmark: 'sbench_create_1to1',
@ -212,10 +218,13 @@ export async function sbench_create_2to1() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_2to1, COUNT / 2, COUNT); bench(create_computations_2to1, COUNT / 2, COUNT);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_2to1', benchmark: 'sbench_create_2to1',
@ -231,10 +240,13 @@ export async function sbench_create_4to1() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_4to1, COUNT / 4, COUNT); bench(create_computations_4to1, COUNT / 4, COUNT);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_4to1', benchmark: 'sbench_create_4to1',
@ -250,10 +262,13 @@ export async function sbench_create_1000to1() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1000to1, COUNT / 1000, COUNT); bench(create_computations_1000to1, COUNT / 1000, COUNT);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1000to1', benchmark: 'sbench_create_1000to1',
@ -269,10 +284,13 @@ export async function sbench_create_1to2() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to2, COUNT, COUNT / 2); bench(create_computations_1to2, COUNT, COUNT / 2);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1to2', benchmark: 'sbench_create_1to2',
@ -288,10 +306,13 @@ export async function sbench_create_1to4() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to4, COUNT, COUNT / 4); bench(create_computations_1to4, COUNT, COUNT / 4);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1to4', benchmark: 'sbench_create_1to4',
@ -307,10 +328,13 @@ export async function sbench_create_1to8() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to8, COUNT, COUNT / 8); bench(create_computations_1to8, COUNT, COUNT / 8);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1to8', benchmark: 'sbench_create_1to8',
@ -326,10 +350,13 @@ export async function sbench_create_1to1000() {
} }
const { timing } = await fastest_test(10, () => { const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) { const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to1000, COUNT, COUNT / 1000); bench(create_computations_1to1000, COUNT, COUNT / 1000);
} }
}); });
destroy();
});
return { return {
benchmark: 'sbench_create_1to1000', benchmark: 'sbench_create_1to1000',

Loading…
Cancel
Save