Skip to content

perf(speech): replace speak settings polling with listener#488

Closed
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-speak-settings-listener
Closed

perf(speech): replace speak settings polling with listener#488
JustYannicc wants to merge 1 commit into
SuperCmdLabs:mainfrom
JustYannicc:codex/perf-speak-settings-listener

Conversation

@JustYannicc

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces the speak manager's 2s settings polling loop with one initial settings load plus the existing settings-updated preload event.
  • Keeps the configured TTS model/voice and runtime speakOptions sync behavior in a small tested helper.
  • Cleans up the settings listener on unmount.

Before / After Evidence

  • Baseline instrumentation before product edits found idle getSettings calls at t=0, 2000, 4000, 6000ms, or 4 calls over a 6.5s idle window.
  • After this change, the hook has one initial getSettings() call on mount and no settings polling interval. While idle, additional settings reads are 0; live changes arrive through onSettingsUpdated.
  • This removes roughly 30 idle getSettings calls per minute per mounted speak manager, about 1,800 calls per hour in a long session.

Validation

  • node scripts/test-speak-settings-listener.mjs passed.
  • node --test 'scripts/test-*.mjs' passed: 28 passing, 1 skipped Electron-live test.
  • node_modules/.bin/tsc -p tsconfig.main.json passed.
  • node_modules/.bin/vite build passed.
  • Codex LSP diagnostics on useSpeakManager.ts and speak-settings-sync.ts: no errors.
  • node scripts/check-i18n.mjs exited 0; it reports two existing Italian missing keys unrelated to this change. No user-facing strings were added or changed.

Notes

  • npm is intentionally disabled on this machine and its wrapper attempted a pnpm install that is blocked by pnpm's ignored-build policy, so validation used the underlying script commands directly from node_modules.

@JustYannicc JustYannicc changed the title [codex] Replace speak settings polling with listener perf(speech): replace speak settings polling with listener Jul 3, 2026
@JustYannicc

Copy link
Copy Markdown
Collaborator Author

Superseded by consolidated upstream PR #534 (perf(mac): reduce native polling and async IO stalls), which carries this change together with the related macOS/native/audio/camera async IO performance fixes. Closing this source PR so review can continue on #534.

@JustYannicc JustYannicc closed this Jul 3, 2026
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