%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#88C0D0', 'secondaryColor': '#BF616A'}}}%% graph LR A["Main Thread"] --> B["zsc = zs[:]\n(one copy)"] B --> C["Job 0 ← reads zsc\n(read-only)"] B --> D["Job 1 ← reads zsc\n(read-only)"] B --> E["Job N ← reads zsc\n(read-only)"] A --> F["Collect results\nzs[i] = zi"] F --> G["Next iteration"] style A fill:#5E81AC,color:#fff style B fill:#A3BE8C,color:#fff
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#88C0D0'}}}%% graph TD A["Python Memory Issue"] --> B["Missing __slots__?"] A --> C["Pre-allocated arrays?"] A --> D["Full copies instead of view?"] A --> E["Recomputed instead of cached?"] A --> F["Redundant temp allocations?"] B --> B1["Add __slots__ 🟢"] C --> C1["Lazy init / sentinel 🟡"] D --> D1["GapDict view / journal 🟡"] E --> E1["Cache by invariant key 🟡"] F --> F1["Pre-allocate + reuse 🟡"] style B1 fill:#A3BE8C,color:#fff style C1 fill:#EBCB8B style D1 fill:#EBCB8B style E1 fill:#EBCB8B style F1 fill:#EBCB8B