Skip to content

Commit 8d606dc

Browse files
ryanoneillclaude
andcommitted
Document CompactString rationale in EnhancedCell module
Explains why CompactString is used for cell symbols: avoids heap allocation for the 1,920+ cells per frame in a typical 80x24 terminal. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fa6edbb commit 8d606dc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/backend/cell/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
//! Enhanced cell type that captures more information than ratatui's Cell.
2+
//!
3+
//! Uses [`CompactString`] for cell symbols to avoid heap allocation for typical
4+
//! single-character cells. At 80×24, a terminal has 1,920 cells per frame;
5+
//! `CompactString` stores up to 24 bytes inline, eliminating thousands of
6+
//! small allocations per render cycle.
27
38
use compact_str::CompactString;
49
use ratatui::style::{Color, Modifier, Style};

0 commit comments

Comments
 (0)