Skip to content

perf: optimize CLI startup performance#18

Merged
xfiive merged 2 commits intofeat/bubble-uifrom
perf/optimize-cli-startup
Feb 24, 2026
Merged

perf: optimize CLI startup performance#18
xfiive merged 2 commits intofeat/bubble-uifrom
perf/optimize-cli-startup

Conversation

@xfiive
Copy link
Member

@xfiive xfiive commented Feb 24, 2026

Summary

  • Add 24-hour cache throttle to the update check so the HTTP call to GitHub is skipped on 99% of CLI invocations, eliminating up to 2 seconds of latency
  • Parallelize GetVersion() and GetCLIVersion() in the --version handler so it completes in ~1 round-trip instead of 3 sequential calls

The existing 4-hour notification interval for non-critical commands is preserved separately from the new 24-hour fetch interval.

`FetchLatestVersion()` previously made an HTTP call on every CLI invocation.
Now the cache stores `LastCheckTime` and skips the HTTP call when within
`checkInterval` (24 hours), using the cached `LatestVersion` instead.
The PersistentPreRun context timeout is increased from 2s to 5s to
accommodate the 3-second HTTP timeout when a fetch does occur.
`GetVersion` and `GetCLIVersion` are now fetched concurrently using
goroutines after the manifest is resolved, reducing `--version` latency
by running both HTTP calls in parallel instead of sequentially.
@xfiive xfiive added the 🛠️ Enhancement New feature or request label Feb 24, 2026
@xfiive xfiive self-assigned this Feb 24, 2026
@xfiive xfiive merged commit a849aae into feat/bubble-ui Feb 24, 2026
@xfiive xfiive deleted the perf/optimize-cli-startup branch February 24, 2026 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ Enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant