Crates.io | hojicha-rendering |
lib.rs | hojicha-rendering |
version | 0.2.1 |
created_at | 2025-08-18 03:03:00.687986+00 |
updated_at | 2025-08-18 03:03:00.687986+00 |
description | High-performance rendering optimization for Hojicha TUI framework |
homepage | https://jgok76.gitea.cloud/femtomc/hojicha |
repository | https://jgok76.gitea.cloud/femtomc/hojicha |
max_upload_size | |
id | 1799890 |
size | 153,002 |
High-performance rendering optimization for the Hojicha TUI framework.
use hojicha_rendering::prelude::*;
use ratatui::layout::Rect;
// Create a differential renderer
let mut renderer = DifferentialRenderer::new();
// Register UI components
renderer.register_component("header", Rect::new(0, 0, 80, 3));
renderer.register_component("content", Rect::new(0, 3, 80, 20));
// Mark components as dirty when they change
renderer.mark_component_dirty("content");
// Check if rendering is needed
if renderer.component_needs_render("content") {
// Render the component
render_content();
// Mark as rendered
renderer.mark_component_rendered("content", None);
}
Based on our benchmarks:
In typical applications with 20% of components changing per frame:
Run the performance comparison:
cargo run --example performance_comparison
The crate is organized into three main modules:
differential
: Core differential rendering system with dirty region trackingcache
: LRU cache for rendered componentsalgorithms
: Geometric algorithms for rectangle operationsGPL-3.0