Skip to content

perf: lazily import resolveConfig#190

Merged
branchseer merged 1 commit intomainfrom
09-23-perf_lazily_import_resolveconfig
Sep 23, 2025
Merged

perf: lazily import resolveConfig#190
branchseer merged 1 commit intomainfrom
09-23-perf_lazily_import_resolveconfig

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Sep 23, 2025

TL;DR

Dynamically import resolveConfig in the resolveUniversalViteConfig function instead of importing it at the top level.

resolveConfig imports rolldown-vite which takes nearly 100ms. It's not actually used if cache is hit. Lazily importing it improves the startup time.

Before:

image.png

After:

image.png

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer marked this pull request as ready for review September 23, 2025 03:42
Copilot AI review requested due to automatic review settings September 23, 2025 03:42
Copy link
Copy Markdown
Contributor

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 optimizes startup performance by lazily importing the resolveConfig function. The change moves the import from the top level to inside the resolveUniversalViteConfig function where it's actually used.

  • Converts static import to dynamic import for resolveConfig
  • Reduces initial bundle load time by avoiding expensive rolldown-vite import when cache is hit

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@branchseer branchseer merged commit b7026ad into main Sep 23, 2025
9 checks passed
Copy link
Copy Markdown
Member Author

Merge activity

@branchseer branchseer deleted the 09-23-perf_lazily_import_resolveconfig branch September 23, 2025 03:49
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.

3 participants