deno icon indicating copy to clipboard operation
deno copied to clipboard

Writing results of `Deno.bench` / checking against previous runs

Open harrysolovay opened this issue 2 years ago • 9 comments

Is there a standard approach to utilizing Deno.bench to safeguard against performance degradation without manually comparing output with that of previous runs?

Currently, I execute deno bench bench.ts > bench_results and pipe its stdout into a file, which I then commit. Upon making changes, I re-run this command. I then manually compare changes to bench_results (in a given PR). Ideally, I would automate this process / turn it into a GH workflow / check. I could not find mention of a solution in the manual's Benchmarking section... and I'd rather not parse the bencher's output, as I'd imagine it may change in future versions of Deno. Any suggestions?

harrysolovay avatar Apr 15 '22 22:04 harrysolovay

Is there a standard approach to utilizing Deno.bench to safeguard against performance degradation without manually comparing output with that of previous runs?

Not yet, it was proposed by @evanwashere who wanted to provide a solution to this problem. But I'm not sure what's the status of that work.

bartlomieju avatar Apr 16 '22 12:04 bartlomieju

Related note for posterity: I see that the previous std approach to benching is deprecated. This approach allowed for in-memory access to the bench data (simplifies serializing that data and then checking against future runs). Anyways, I'm very excited to see how this API progresses!

harrysolovay avatar Apr 16 '22 16:04 harrysolovay

There is a mock design for it, but it will likely only be implemented as a follow-up to #14305

evanwashere avatar Apr 17 '22 08:04 evanwashere

Does https://github.com/denoland/deno/pull/14305 solve this issue @harrysolovay?

bartlomieju avatar Apr 24 '22 19:04 bartlomieju

Somewhat. I was hoping for an API comparable to that of snapshot testing. I could imagine something along the lines of...

import { assertBenchGte } from "...";

Deno.test("Benchmarks are as good or better", (t) => {
  assertBenchGte(t, () => doTheThing());
});

harrysolovay avatar Apr 25 '22 14:04 harrysolovay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 27 '22 22:06 stale[bot]

Pinging this issue to stave off the stale bot.

harrysolovay avatar Jun 27 '22 23:06 harrysolovay

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 08 '22 21:09 stale[bot]

Warding off the stale bot

harrysolovay avatar Sep 08 '22 21:09 harrysolovay