Skip to content

perf: quick wins - webview minify, bounded cache, focus-aware poll#62

Open
CompN3rd wants to merge 1 commit into
mainfrom
perf/quick-wins-webview-minify-bounded-cache-focus-poll
Open

perf: quick wins - webview minify, bounded cache, focus-aware poll#62
CompN3rd wants to merge 1 commit into
mainfrom
perf/quick-wins-webview-minify-bounded-cache-focus-poll

Conversation

@CompN3rd
Copy link
Copy Markdown
Owner

Changes

Three independent performance quick wins:

  1. Webview minification — Added \minify: !watch\ to \scripts/build-webviews.js. Reduces webview bundles by 25–33%:

    • \prDetails.js: 54.2KB → 41.4KB (-23.6%)
    • \planning.js: 45.7KB → 32.4KB (-29.1%)
    • \workItemDetails.js: 42.1KB → 29.6KB (-29.7%)
    • \pipelineRunDetails.js: 32.7KB → 23.3KB (-28.7%)
    • \�uilds.js: 27.5KB → 18.5KB (-32.7%)
  2. Bounded timeline cache — Replaced the unbounded \Map\ in \PipelinesProvider\ with \TimelineCache\ (cap 200 entries). Uses Map insertion order for FIFO eviction. Prevents memory leak in long-running sessions.

  3. Focus-aware polling — \NotificationService.pollOnce()\ now skips when \�scode.window.state.focused\ is \ alse. Eliminates unnecessary ADO API calls while the window is backgrounded.

…e poll

- Add minify: !watch to webview build script (reduces bundles ~25-33%)
- Replace unbounded Map with bounded TimelineCache (cap 200) in PipelinesProvider
- Skip notification polling when VS Code window is unfocused
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR delivers three targeted performance improvements across the extension’s webview build pipeline, pipelines tree view, and notification polling loop to reduce bundle size, bound memory usage, and avoid unnecessary background API traffic.

Changes:

  • Minifies webview bundles in non-watch builds to reduce shipped JS size.
  • Replaces an unbounded pipeline timeline Map cache with a bounded FIFO cache (200 entries) to prevent long-session memory growth.
  • Skips notification polling cycles when the VS Code window is not focused to reduce background ADO API calls.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/providers/pipelinesProvider.ts Introduces a bounded TimelineCache and uses it for timeline record caching to cap memory usage.
src/notifications/notificationService.ts Adds a focus check to avoid polling when the window is unfocused.
scripts/build-webviews.js Enables esbuild minification when not running in --watch mode to shrink webview bundles.

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.

2 participants