Skip to content

⚡ Bolt: Pre-compile punctuation Regex in VoiceInputManager - #643

Merged
LeanBitLab merged 1 commit into
mainfrom
bolt-regex-voice-5017433685908041869
Oct 10, 2026
Merged

LeanBitLab merged 1 commit into
mainfrom
bolt-regex-voice-5017433685908041869

Conversation

@LeanBitLab

Copy link
Copy Markdown
Owner

💡 What: Extracted inline Regex("[,.?!;:]") in VoiceInputManager.syncRecognizedText into a companion object private val PUNCTUATION_REGEX.
🎯 Why: syncRecognizedText is a hot-path method called repeatedly during voice typing updates. Pre-compiling the regex avoids repeated runtime regex compilation and unnecessary object allocation per word/partial phrase.
📊 Expected Impact: Lower GC pressure and minor latency reduction in voice typing input hot path.
🔬 Verification: Standard debug build and unit tests passed. Ensured zero em dashes were introduced.


PR created automatically by Jules for task 5017433685908041869 started by @LeanBitLab

Extract repeated `Regex("[,.?!;:]")` instantiation inside `syncRecognizedText` into a companion object constant `PUNCTUATION_REGEX` to reduce GC pressure on voice typing hot path.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@LeanBitLab
LeanBitLab merged commit 28ea2d9 into main Oct 10, 2026
1 check passed
@LeanBitLab
LeanBitLab deleted the bolt-regex-voice-5017433685908041869 branch October 10, 2026 18:33
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