Benchmarks (#1079)
* tactus-oriented benchmarks * add benchmarks for individual example tunes
This commit is contained in:
parent
8e2d883e86
commit
e47d67a9da
6 changed files with 96 additions and 0 deletions
22
bench/tunes.bench.mjs
Normal file
22
bench/tunes.bench.mjs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { queryCode, testCycles } from '../test/runtime.mjs';
|
||||
import * as tunes from '../website/src/repl/tunes.mjs';
|
||||
import { describe, bench } from 'vitest';
|
||||
import { calculateTactus } from '../packages/core/index.mjs';
|
||||
|
||||
const tuneKeys = Object.keys(tunes);
|
||||
|
||||
describe('renders tunes', () => {
|
||||
tuneKeys.forEach((key) => {
|
||||
describe(key, () => {
|
||||
calculateTactus(true);
|
||||
bench(`+tactus`, async () => {
|
||||
await queryCode(tunes[key], testCycles[key] || 1);
|
||||
});
|
||||
calculateTactus(false);
|
||||
bench(`-tactus`, async () => {
|
||||
await queryCode(tunes[key], testCycles[key] || 1);
|
||||
});
|
||||
calculateTactus(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue