Repository navigation
perf(project): normalize caption words in place - #3436
Open
OptimistOtaku wants to merge 1 commit into
Open
OptimistOtaku wants to merge 1 commit into
OptimistOtaku wants to merge 1 commit into
Conversation
Contributor
|
@OptimistOtaku is attempting to deploy a commit to the Cap Software Inc Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
This branch has not been deployed
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.
GPUI's Whisper and Parakeet caption paths pass owned word vectors to
normalize_caption_words, which allocates a second vector and copies every retained word's text. Normalize the existing vector and strings in place, then attach punctuation before applying the existing duration cap.This retains Unicode trimming, leading/consecutive punctuation, word order, start/end float bits, caption text, and chunk boundaries. Punctuation may still grow the preceding string. No dependencies, public API, project format, or platform-specific code change.
Measurements
Native Windows x86_64, Ryzen 5 5600H, Rust 1.88 GNU, repository release profile (
opt-level=s, thin LTO). Median of nine alternating paired samples after warmups. Input batches are cloned before the timer; timings include normalization and dropping the complete output. The benchmark compares the exact upstream function against production code and checks full output equivalence before timing.A second complete run also improved every case. These are normalization timings, excluding speech recognition, model loading, and UI work.
cargo test --locked -p cap-project --release --lib benchmark_caption_word_normalization -- --ignored --nocaptureValidation
cargo fmt --all,cargo check --locked -p cap-projectcargo test --locked -p cap-project: 196 library tests and four integration tests passed; five benchmarks ignored by default, new benchmark run separately.cargo clippy --locked -p cap-project --all-targets -- -D warningsgit diff --checkDifferential cases cover Unicode/ASCII whitespace, empty tokens, punctuation chains, multilingual text, signed zero, NaN/infinite times, duration clamping, rendered text, and grouping. A separate test verifies reuse of vector and string allocations. Native GPUI launch is unverified locally. Fork Actions dispatch is disabled by GitHub; upstream PR CI will provide additional platform validation.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Changes
normalize_caption_wordsto reuse the owned vector and strings instead of copying retained words.Reviews (1) · Last reviewed commit: "perf(project): normalize caption words i..." · Reviewed by Greptile