Skip to content

Commit ce56631

Browse files
committed
perf(core): incremental drawlist emission
Add damage-based rendering in WidgetRenderer for render-only updates and content-update bench. Includes identity-diff damage tracking, damage-rect culling, and regression tests.
1 parent 7bc16a4 commit ce56631

11 files changed

Lines changed: 1666 additions & 91 deletions

File tree

packages/bench/src/ratatui-runner.ts

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,42 @@ export function checkRatatui(): boolean {
2626
}
2727

2828
let _built = false;
29+
let _buildError: Error | null = null;
2930

3031
/** Build the ratatui-bench binary in release mode. */
3132
export function ensureBuilt(): void {
3233
if (_built && existsSync(BINARY)) return;
34+
if (existsSync(BINARY)) {
35+
_built = true;
36+
return;
37+
}
38+
if (_buildError) throw _buildError;
3339
console.log("\n [ratatui] Building release binary...");
34-
execSync("cargo build --release", {
35-
cwd: BENCH_DIR,
36-
stdio: ["ignore", "ignore", "inherit"],
37-
timeout: 120_000,
38-
});
39-
_built = true;
40+
try {
41+
execSync("cargo build --release", {
42+
cwd: BENCH_DIR,
43+
stdio: ["ignore", "ignore", "inherit"],
44+
timeout: 120_000,
45+
});
46+
_built = true;
47+
} catch (err) {
48+
// We sometimes end up with a corrupt/half-populated `target/` (e.g., checked-in artifacts,
49+
// interrupted builds). A clean rebuild is a pragmatic recovery path.
50+
console.log(" [ratatui] Build failed; running `cargo clean` and retrying once...");
51+
try {
52+
execSync("cargo clean", { cwd: BENCH_DIR, stdio: ["ignore", "ignore", "inherit"] });
53+
execSync("cargo build --release", {
54+
cwd: BENCH_DIR,
55+
stdio: ["ignore", "ignore", "inherit"],
56+
timeout: 120_000,
57+
});
58+
_built = true;
59+
} catch (err2) {
60+
_buildError =
61+
err2 instanceof Error ? err2 : new Error(`ratatui ensureBuilt failed: ${String(err2)}`);
62+
throw _buildError;
63+
}
64+
}
4065
}
4166

4267
interface RatatuiOutput {

0 commit comments

Comments
 (0)