D
Deno

help

using data from one deno bench in another

Aabi2/2/2023
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)
}
},
})
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)
}
},
})
AAapoAlas2/2/2023
Push into an array or other.

Looking for more? Join the community!