-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
benchmark.ts
30 lines (22 loc) · 978 Bytes
/
benchmark.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import b from 'benny';
import { createSierpinskiTriangle, createSierpinskiCarpet } from './src/';
b.suite(
'Triangle',
b.add('Depth: 1', () => createSierpinskiTriangle({ size: 1000, depth: 1 })),
b.add('Depth: 2', () => createSierpinskiTriangle({ size: 1000, depth: 2 })),
b.add('Depth: 3', () => createSierpinskiTriangle({ size: 1000, depth: 3 })),
b.add('Depth: 4', () => createSierpinskiTriangle({ size: 1000, depth: 4 })),
b.cycle(),
b.complete(),
b.save({ file: 'result', folder: '.bench', format: 'chart.html' }),
);
b.suite(
'Carpet',
b.add('Depth: 1', () => createSierpinskiCarpet({ size: 1000, depth: 1 })),
b.add('Depth: 2', () => createSierpinskiCarpet({ size: 1000, depth: 2 })),
b.add('Depth: 3', () => createSierpinskiCarpet({ size: 1000, depth: 3 })),
b.add('Depth: 4', () => createSierpinskiCarpet({ size: 1000, depth: 4 })),
b.cycle(),
b.complete(),
b.save({ file: 'result', folder: '.bench', format: 'chart.html' }),
);