perf: cache print templates and borrow formatting arguments - #306
Open
swananan wants to merge 1 commit into
Open
perf: cache print templates and borrow formatting arguments#306swananan wants to merge 1 commit into
swananan wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formatted
printevents 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 -- --checkcargo test -p ghostscope-protocol --release --all-features— 93 tests passedcargo clippy --release --all-targets --all-features -- -D warnings -D clippy::undocumented_unsafe_blockscargo test -p ghostscope-e2e-tests --tests --all-features— full standard host run passed through the runner service, including late-start library globals and value diagnosticsContainer topology tests were skipped because this change does not affect container behavior.