Skip to content

perf: cache print templates and borrow formatting arguments - #306

Open
swananan wants to merge 1 commit into
mainfrom
perf/cache-print-formatting
Open

perf: cache print templates and borrow formatting arguments#306
swananan wants to merge 1 commit into
mainfrom
perf/cache-print-formatting

Conversation

@swananan

Copy link
Copy Markdown
Owner

Formatted print events reparse the same template and copy argument data before rendering, adding repeated work to both CLI and TUI event handling.

Cache parsed templates per streaming parser and refresh an entry when its source string changes. Borrow payload bytes and valid UTF-8 access paths until formatting completes; completed events retain owned output strings. Cover fragmented input, buffer reuse, context replacement, and malformed arguments, and add warm-parser benchmarks for scalar arguments and character buffers.

Validation

  • cargo fmt --all -- --check
  • cargo test -p ghostscope-protocol --release --all-features — 93 tests passed
  • cargo clippy --release --all-targets --all-features -- -D warnings -D clippy::undocumented_unsafe_blocks
  • cargo test -p ghostscope-e2e-tests --tests --all-features — full standard host run passed through the runner service, including late-start library globals and value diagnostics

Container topology tests were skipped because this change does not affect container behavior.

Reuse parsed templates across events in each streaming parser, refreshing an
entry when its source string changes. Borrow payload bytes and valid UTF-8
access paths until formatting completes, while keeping event output owned.

Cover context replacement, fragmented input, and buffer reuse, and add
complex-format benchmarks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant