mirror of
https://github.com/eliasstepanik/strudel.git
synced 2026-01-10 21:28:31 +00:00
* polish, rename, and document stepwise functions: `pace`, `take`, `drop`, `expand`, `contract`, `repeat`, `zip`, `grow`, `shrink`, and `tour`
47 lines
885 B
JavaScript
47 lines
885 B
JavaScript
import { describe, bench } from 'vitest';
|
|
|
|
import { calculateTactus, sequence, stack } from '../index.mjs';
|
|
|
|
const pat64 = sequence(...Array(64).keys());
|
|
|
|
describe('steps', () => {
|
|
calculateTactus(true);
|
|
bench(
|
|
'+tactus',
|
|
() => {
|
|
pat64.iter(64).fast(64).firstCycle();
|
|
},
|
|
{ time: 1000 },
|
|
);
|
|
|
|
calculateTactus(false);
|
|
bench(
|
|
'-tactus',
|
|
() => {
|
|
pat64.iter(64).fast(64).firstCycle();
|
|
},
|
|
{ time: 1000 },
|
|
);
|
|
});
|
|
|
|
describe('stack', () => {
|
|
calculateTactus(true);
|
|
bench(
|
|
'+tactus',
|
|
() => {
|
|
stack(pat64, pat64, pat64, pat64, pat64, pat64, pat64, pat64).fast(64).firstCycle();
|
|
},
|
|
{ time: 1000 },
|
|
);
|
|
|
|
calculateTactus(false);
|
|
bench(
|
|
'-tactus',
|
|
() => {
|
|
stack(pat64, pat64, pat64, pat64, pat64, pat64, pat64, pat64).fast(64).firstCycle();
|
|
},
|
|
{ time: 1000 },
|
|
);
|
|
});
|
|
calculateTactus(true);
|