Skip to content

chore: improve internal benchmarking #13620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 54 additions & 27 deletions benchmarking/benchmarks/sbench.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,12 @@ export async function sbench_create_0to1() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_0to1, COUNT, 0);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_0to1, COUNT, 0);
}
});
destroy();
});

return {
Expand All @@ -193,9 +196,12 @@ export async function sbench_create_1to1() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1to1, COUNT, COUNT);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to1, COUNT, COUNT);
}
});
destroy();
});

return {
Expand All @@ -212,9 +218,12 @@ export async function sbench_create_2to1() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_2to1, COUNT / 2, COUNT);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_2to1, COUNT / 2, COUNT);
}
});
destroy();
});

return {
Expand All @@ -231,9 +240,12 @@ export async function sbench_create_4to1() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_4to1, COUNT / 4, COUNT);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_4to1, COUNT / 4, COUNT);
}
});
destroy();
});

return {
Expand All @@ -250,9 +262,12 @@ export async function sbench_create_1000to1() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1000to1, COUNT / 1000, COUNT);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1000to1, COUNT / 1000, COUNT);
}
});
destroy();
});

return {
Expand All @@ -269,9 +284,12 @@ export async function sbench_create_1to2() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1to2, COUNT, COUNT / 2);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to2, COUNT, COUNT / 2);
}
});
destroy();
});

return {
Expand All @@ -288,9 +306,12 @@ export async function sbench_create_1to4() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1to4, COUNT, COUNT / 4);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to4, COUNT, COUNT / 4);
}
});
destroy();
});

return {
Expand All @@ -307,9 +328,12 @@ export async function sbench_create_1to8() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1to8, COUNT, COUNT / 8);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to8, COUNT, COUNT / 8);
}
});
destroy();
});

return {
Expand All @@ -326,9 +350,12 @@ export async function sbench_create_1to1000() {
}

const { timing } = await fastest_test(10, () => {
for (let i = 0; i < 100; i++) {
bench(create_computations_1to1000, COUNT, COUNT / 1000);
}
const destroy = $.effect_root(() => {
for (let i = 0; i < 10; i++) {
bench(create_computations_1to1000, COUNT, COUNT / 1000);
}
});
destroy();
});

return {
Expand Down