abiA
Denoβ€’3y agoβ€’
1 reply
abi

using data from one deno bench in another

is there any good way to re-use the results generated in one deno bench in another one?

example:

Deno.bench({
  name: "parse 1000 source files",
  fn: (): void => {
    sourceFiles.forEach((source) => {
      const ast = parse(source)
    }
  },
})

Deno.bench({
  name: "evaluate 1000 ASTs",
  fn: (): void => {
    sourceFiles.forEach((source) => {
      // note that we're re-parsing here!
      const ast = parse(source)
      const result = evaluate(ast)
    }
  },
})
Was this page helpful?