Skip to content

Instantly share code, notes, and snippets.

View jake-danton's full-sized avatar

Jake Danton jake-danton

View GitHub Profile
@jake-danton
jake-danton / compareResultImplementations.bench.ts
Created September 24, 2025 17:14
Vitest Bench for new Result monomorphic object implementation compared to previous "tuple" version
// This is a implementation comparison benchmark test you can copy into the repo and run
// Note: because Tinybench/Vitest benchmarks do not accurately report performance of super fast code,
// so I have added a configurable `innerLoops` for running the commands many times per bench run.
// This comes with the upside of getting more consistent result with Tinybench/Vitest, but it also
// comes with a downside of the JS runtime super-optimizing the monomorphic object
import * as _ from 'radashi'
// Purely inner loops - 1.05x creating, 4.56x using, 4.27x isResult
// const benchOptions = { iterations: 1, warmupIterations: 1 }
{
"title": "Bad Wordle",
"answers": [
"meany",
"dummy"
]
}