-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: fast path for cached dyn imports (#906)
This patch adds a fast path for already loaded and evaluated dynamic imports by immediately resolving the promise and skipping most of the event loop machinery. ![image](https://github.com/user-attachments/assets/6557277a-3c8a-4cee-b7b6-15b31fdbb7bd) ```js // Warmup await import('./other.mjs') await import('./other.mjs') await import('./other.mjs') await import('./other.mjs') await import('./other.mjs') const start = Date.now() for (let i = 0; i < 100000; i++) { await import('./other.mjs') } ```
- Loading branch information
1 parent
5530791
commit 3af141c
Showing
4 changed files
with
43 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters