kairo_mux.bench.js — svelte Source File
Architecture documentation for kairo_mux.bench.js, a javascript file in the svelte codebase. 2 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR 6e2abc37_08df_856a_aa91_e552d217d410["kairo_mux.bench.js"] d3dc1520_5a13_e6ad_9208_466ecffe2410["node:assert"] 6e2abc37_08df_856a_aa91_e552d217d410 --> d3dc1520_5a13_e6ad_9208_466ecffe2410 1a59b12b_63d5_2eb4_1881_6fb96dbdcb56["client"] 6e2abc37_08df_856a_aa91_e552d217d410 --> 1a59b12b_63d5_2eb4_1881_6fb96dbdcb56 style 6e2abc37_08df_856a_aa91_e552d217d410 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import assert from 'node:assert';
import * as $ from 'svelte/internal/client';
export default () => {
let heads = new Array(100).fill(null).map((_) => $.state(0));
const mux = $.derived(() => {
return Object.fromEntries(heads.map((h) => $.get(h)).entries());
});
const splited = heads
.map((_, index) => $.derived(() => $.get(mux)[index]))
.map((x) => $.derived(() => $.get(x) + 1));
const destroy = $.effect_root(() => {
splited.forEach((x) => {
$.render_effect(() => {
$.get(x);
});
});
});
return {
destroy,
run() {
for (let i = 0; i < 10; i++) {
$.flush(() => {
$.set(heads[i], i);
});
assert.equal($.get(splited[i]), i + 1);
}
for (let i = 0; i < 10; i++) {
$.flush(() => {
$.set(heads[i], i * 2);
});
assert.equal($.get(splited[i]), i * 2 + 1);
}
}
};
};
Dependencies
- client
- node:assert
Source
Frequently Asked Questions
What does kairo_mux.bench.js do?
kairo_mux.bench.js is a source file in the svelte codebase, written in javascript.
What does kairo_mux.bench.js depend on?
kairo_mux.bench.js imports 2 module(s): client, node:assert.
Where is kairo_mux.bench.js in the architecture?
kairo_mux.bench.js is located at benchmarking/benchmarks/reactivity/tests/kairo_mux.bench.js (directory: benchmarking/benchmarks/reactivity/tests).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free