%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#88C0D0', 'primaryTextColor': '#000', 'primaryBorderColor': '#333'}}}%% pie title Where does your C++ RAM go? "unordered_map overhead" : 35 "Unnecessary copies / temps" : 25 "Cached data (never freed)" : 20 "Container overhead (list, ptr)" : 15 "Actual useful data" : 5
graph TD subgraph "Before: Triple Storage โ" M1["owned_nodes\nvector<unique_ptr>"] -->|heap alloc| N1["Node"] M2["nodes\nunordered_map<string, ptr>"] -->|hash + string| N1 M3["source_node\nby-value member"] --> N1 end subgraph "After: Single Arena โ " A1["_arena\ndeque<RoutingNode>"] -->|contiguous| N2["All Nodes"] M4["nodes\nunordered_map<string, ptr>"] -->|into arena| N2 end style M1 fill:#ffcdd2,stroke:#c62828,stroke-width:3px style M2 fill:#ffcdd2,stroke:#c62828,stroke-width:3px style M3 fill:#ffcdd2,stroke:#c62828,stroke-width:3px style A1 fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px style M4 fill:#bbdefb,stroke:#01579b,stroke-width:3px
graph TD subgraph Flat["Flat Processing - HIGH Memory โ"] A["Full Chip Data"] --> B["Synthesis"] A --> C["Routing"] A --> D["Analysis"] end subgraph Hierarchical["Hierarchical Processing - LOW Memory โ "] E["Top-Level Shell"] --> F["Block A Model"] E --> G["Block B Model"] E --> H["Block C Model"] F --> I["Process A Independently"] G --> J["Process B Independently"] H --> K["Process C Independently"] end style Flat fill:#ffcdd2,stroke:#c62828,stroke-width:3px style Hierarchical fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px
graph LR subgraph Client["Client: Extrinsic Data"] T1["Tree 1: X=10, Y=5"] T2["Tree 2: X=20, Y=8"] Tn["Tree N: X=..."] end subgraph Factory["Flyweight Factory: Cache"] F1["Oak Mesh โ "] F2["Pine Mesh โ "] end T1 -->|ref| F1 T2 -->|ref| F2 Tn -->|ref| F1 style Factory fill:#bbdefb,stroke:#01579b,stroke-width:3px style Client fill:#fff9c4,stroke:#f57f17,stroke-width:3px
graph LR A["Your Application"] --> B{"Profile It"} B --> C["C++: Valgrind / Heaptrack"] B --> D["Java: JVisualVM / JProfiler"] B --> E["Python: memory_profiler"] B --> F["OS: /proc/pid/smaps"] C & D & E & F --> G["Identify Top 20% Consumers"] G --> H["Apply Patterns"] style G fill:#ffe0b2,stroke:#e65100,stroke-width:3px style H fill:#c8e6c9,stroke:#2e7d32,stroke-width:3px
%%{init: {'theme': 'base', 'themeVariables': { 'primaryColor': '#4CAF50', 'primaryTextColor': '#fff'}}}%% graph LR A["๐ Faster App"] --> B["โ Less RAM"] B --> C["๐ฐ Lower Costs"] C --> D["๐ Happy Users"] style A fill:#c8e6c9,stroke:#2e7d32,color:#2e3440,stroke-width:3px style D fill:#e3f2fd,stroke:#1565c0,color:#2e3440,stroke-width:3px