strudel/bench/tunes.bench.mjs
Alex McLean ce9d23049a
Polish, rename, and document stepwise functions (#1262)
* polish, rename, and document stepwise functions: `pace`, `take`, `drop`, `expand`, `contract`, `repeat`, `zip`, `grow`, `shrink`, and `tour`
2025-02-02 20:26:44 +00:00

23 lines
662 B
JavaScript

import { queryCode, testCycles } from '../test/runtime.mjs';
import * as tunes from '../website/src/repl/tunes.mjs';
import { describe, bench } from 'vitest';
import { calculateSteps } from '../packages/core/index.mjs';
const tuneKeys = Object.keys(tunes);
describe('renders tunes', () => {
tuneKeys.forEach((key) => {
describe(key, () => {
calculateSteps(true);
bench(`+steps`, async () => {
await queryCode(tunes[key], testCycles[key] || 1);
});
calculateSteps(false);
bench(`-steps`, async () => {
await queryCode(tunes[key], testCycles[key] || 1);
});
calculateSteps(true);
});
});
});