%%{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:#e3f2fd,stroke:#1565c0,color:#2e3440,stroke-width:3px style B fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px
%%{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:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style C1 fill:#fff9c4,stroke:#f57f17,stroke-width:3px style D1 fill:#fff9c4,stroke:#f57f17,stroke-width:3px style E1 fill:#fff9c4,stroke:#f57f17,stroke-width:3px style F1 fill:#fff9c4,stroke:#f57f17,stroke-width:3px