Repository navigation
⚡ Bolt: Pre-compile punctuation Regex in VoiceInputManager - #643
Conversation
Extract repeated `Regex("[,.?!;:]")` instantiation inside `syncRecognizedText` into a companion object constant `PUNCTUATION_REGEX` to reduce GC pressure on voice typing hot path.
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
💡 What: Extracted inline
Regex("[,.?!;:]")inVoiceInputManager.syncRecognizedTextinto acompanion objectprivate valPUNCTUATION_REGEX.🎯 Why:
syncRecognizedTextis 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