XuqmGroup-H5SDK/node_modules/alien-signals/benchs/complex.mjs
徐勤民 e34fa2052a feat(private): add private deployment SDK module
Adds @xuqm/h5-sdk/private entry point with JSON-based initialization,
feature gating, and error codes for private deployment scenarios.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:08:08 +08:00

25 行
606 B
JavaScript

import { run, bench, boxplot } from 'mitata';
import { computed, effect, signal } from '../esm/index.mjs';
boxplot(() => {
bench('complex: $w * $h', function* (state) {
const w = state.get('w');
const h = state.get('h');
const src = signal({ w, h });
for (let i = 0; i < w; i++) {
let last = src;
for (let j = 0; j < h; j++) {
const prev = last;
last = computed(() => ({ [`${i}-${j}`]: prev.get() }));
}
effect(() => last.get());
}
yield () => src.set({ upstream: src.get() });
})
.args('h', [1, 10, 100])
.args('w', [1, 10, 100]);
});
run({ format: 'markdown' });