Skip to content

Defer loading of Blob/Queue/Table server modules to reduce extension codeLoadingTime - #2766

Open
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-performance-issue-azurite
Open

Defer loading of Blob/Queue/Table server modules to reduce extension codeLoadingTime#2766
Akanksha Jain (jainakanksha-msft) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-performance-issue-azurite

Conversation

Copilot AI commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Extension activation reported a codeLoadingTime of ~10 seconds, since extension.ts statically imported VSCServerManagerBlob/Queue/Table, which transitively pull in the full Blob/Queue/Table server implementations (express, middleware, request handlers, etc.). VS Code requires the extension's main module synchronously before calling activate(), so this entire dependency graph was being loaded synchronously at module load time — exactly what codeLoadingTime measures.

Changes

  • src/extension.ts: replaced static imports of VSCServerManagerBlob, VSCServerManagerQueue, and VSCServerManagerTable with dynamic import() calls made in parallel inside activate() (now async).
export async function activate(context: ExtensionContext) {
  const [
    { default: VSCServerManagerBlob },
    { default: VSCServerManagerQueue },
    { default: VSCServerManagerTable }
  ] = await Promise.all([
    import("./common/VSCServerManagerBlob"),
    import("./common/VSCServerManagerQueue"),
    import("./common/VSCServerManagerTable")
  ]);
  // ...rest of activation unchanged
}

This moves the cost of loading the heavy server modules from synchronous module load (blocking codeLoadingTime) to an async step during activation, without changing any command registration, status bar, or event listener wiring.

Copilot AI lite review requested due to automatic review settings September 2, 2026 12:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI linked an issue Sep 2, 2026 that may be closed by this pull request
…adingTime

Co-authored-by: jainakanksha-msft <181211853+jainakanksha-msft@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 2, 2026 12:30
Copilot AI changed the title [WIP] Fix performance issue for Azurite extension Defer loading of Blob/Queue/Table server modules to reduce extension codeLoadingTime Sep 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The user-visible extension performance improvement should be reflected in ChangeLog.md under “Upcoming Release” to align with the repo’s release-note practices.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment thread src/extension.ts
Comment on lines +12 to +15
// at module load time. This significantly reduces the extension's
// "codeLoadingTime" reported by VS Code, since the cost of loading these
// modules is deferred to an asynchronous import instead of being paid
// synchronously while VS Code loads the extension's main module.
@jainakanksha-msft

Copy link
Copy Markdown
Member

Copilot what are the solutions of this problem with all the pros and cons.

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.

Extension issue

3 participants