Raxol.Terminal.Renderer.CachedStyleRenderer (Raxol v2.0.1)
View SourceHigh-performance terminal renderer with style string caching.
Phase 2 optimization targeting the critical bottleneck:
- Style string building: 44.9% of render time
- Target: Reduce from 1461μs to <500μs (65% improvement)
Key optimizations:
- LRU cache for compiled CSS style strings
- Pre-compiled templates for common styles
- Batch processing for consecutive identical styles
- Memory-efficient string building
Summary
Functions
Get cache performance statistics.
Creates a new cached style renderer.
Renders the terminal content with cached style optimization.
Renders the terminal content and returns both content and updated renderer with cache. Use this for stateful rendering where you want to preserve cache between renders.
Reset cache statistics.
Types
@type t() :: %Raxol.Terminal.Renderer.CachedStyleRenderer{ cache_hits: non_neg_integer(), cache_misses: non_neg_integer(), cursor: {non_neg_integer(), non_neg_integer()} | nil, font_settings: map(), screen_buffer: Raxol.Terminal.ScreenBuffer.t(), style_cache: map(), theme: map() }
Functions
Get cache performance statistics.
Creates a new cached style renderer.
Renders the terminal content with cached style optimization.
Renders the terminal content and returns both content and updated renderer with cache. Use this for stateful rendering where you want to preserve cache between renders.
Reset cache statistics.