Skip to content

Commit 82a63e3

Browse files
committed
test: use external js-reactivity-benchmark package
1 parent 56cdb73 commit 82a63e3

20 files changed

+636
-1152
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- uses: benchmark-action/github-action-benchmark@d48d326b4ca9ba73ca0cd0d59f108f9e02a381c7 #v1.20.4
3232
with:
3333
name: Tansu benchmarks
34-
tool: 'customBiggerIsBetter'
34+
tool: 'customSmallerIsBetter'
3535
output-file-path: benchmarks.json
3636
auto-push: ${{ github.event_name == 'push' }}
3737
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ dist
33
temp
44
coverage
55
.angular
6-
benchmarks.json
6+
*benchmarks.json
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import type { ReactiveFramework } from 'js-reactivity-benchmark';
2+
import { writable, computed, batch } from '../../src/index';
3+
4+
export const tansuFramework: ReactiveFramework = {
5+
name: '@amadeus-it-group/tansu',
6+
signal: (initialValue) => {
7+
const w = writable(initialValue);
8+
return {
9+
write: w.set,
10+
read: w,
11+
};
12+
},
13+
computed: (fn) => {
14+
const c = computed(fn);
15+
return {
16+
read: c,
17+
};
18+
},
19+
effect: (fn) => computed(fn).subscribe(() => {}),
20+
withBatch: batch,
21+
withBuild: (fn) => fn(),
22+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { writeFile } from 'fs/promises';
2+
import {
3+
runTests,
4+
formatPerfResultStrings,
5+
formatPerfResult,
6+
perfResultHeaders,
7+
} from 'js-reactivity-benchmark';
8+
import { tansuFramework } from './adapter';
9+
10+
(async () => {
11+
console.log(formatPerfResultStrings(perfResultHeaders()));
12+
const results: { name: string; value: number; unit: string }[] = [];
13+
await runTests([{ framework: tansuFramework, testPullCounts: true }], (result) => {
14+
console.log(formatPerfResult(result));
15+
results.push({ name: result.test, value: result.time, unit: 'ms' });
16+
});
17+
await writeFile('js-reactivity-benchmarks.json', JSON.stringify(results, null, ' '));
18+
})();

benchmarks/js-reactivity-benchmarks/cellxBench.bench.ts

Lines changed: 0 additions & 94 deletions
This file was deleted.

0 commit comments

Comments
 (0)