Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
315 changes: 312 additions & 3 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions crates/ratatui-textwrap/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "ratatui-textwrap"
version = "0.0.1"
publish = true
autobenches = false
edition.workspace = true
license.workspace = true
repository.workspace = true
Expand All @@ -20,9 +21,23 @@ ratatui-core = "0.1.2"
textwrap = { version = "0.16", default-features = false, features = ["smawk"] }

[dev-dependencies]
criterion = { version = "0.8.2", features = ["csv_output", "html_reports"] }
pretty_assertions = "1"
ratatui = { version = "0.30", features = ["unstable-rendered-line-info"] }
rstest = "0.26"
stats_alloc = "0.1.10"

[lints]
workspace = true

[[bench]]
name = "textwrap-workflows"
harness = false

[[bench]]
name = "textwrap-stress"
harness = false

[[bench]]
name = "textwrap-allocations"
harness = false
10 changes: 10 additions & 0 deletions crates/ratatui-textwrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ The [design notes](docs/design.md) record why the current API has this shape, wh
comparison taught us, and which follow-up ideas remain open questions rather than promised
features.

## Benchmarks

The benchmark suite compares native `Paragraph` wrapping with paragraph-compatible, first-fit, and
optimal-fit materialization. It covers line counting, rendering, repeated cached rendering,
terminal resizing, and scrolled viewports using deterministic styled inputs.

See the [benchmark guide](docs/benchmarks.md) for the workload definitions and commands. The
[latest checked-in results](docs/benchmark-results.md) record one machine-specific reference run;
use Criterion baselines for before-and-after comparisons on the same machine.

The implementation follows textwrap's [fragment contract], [first-fit source], and [optimal-fit
source]. `ParagraphCompat` follows Ratatui's [WordWrapper source] and [Paragraph integration].

Expand Down
Loading
Loading