Add comprehensive memory accounting, string interning, and targeted
optimizations across all browser subsystems:
- New `memory` crate: MemoryReport/SubsystemStats for profiling,
Atom (Rc<str>-backed interned strings), CompactString (22-byte SSO),
typed Arena<T> bump allocator
- DOM: tag names and attribute names now use Atom for deduplication,
reducing per-element memory by ~7x for repeated tags; memory_usage()
and element/text node counting methods added
- Style: font_family uses Atom instead of String (saves 16 bytes per
ComputedStyle); StyleCache gains len/is_empty/memory_usage methods;
ComputedStyle.heap_bytes() for dynamic field accounting
- Layout: LayoutTree gains box_count(), memory_usage(), LayoutHints
for pre-allocation across frames
- Render: display list compaction via build_display_list_into() that
reuses buffer capacity; LayerTree.memory_usage() and utilization
tracking for glyph atlas
- JS GC: adaptive threshold (1.5x growth factor, capped at 1M),
heap compaction when free ratio exceeds 50%, memory_usage() method
- Net: HttpClient.memory_usage(), pooled/h2 connection counts
- Text: GlyphCache.memory_usage() for bitmap data tracking
- Browser: memory_stats module aggregating all subsystem stats into
a formatted MemoryReport for debug/about:memory display
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>