Skip to content

perf(load): defer findWASM until native binary is missing#78

Merged
szegedi merged 1 commit intomainfrom
watson/perf
Mar 3, 2026
Merged

perf(load): defer findWASM until native binary is missing#78
szegedi merged 1 commit intomainfrom
watson/perf

Conversation

@watson
Copy link
Copy Markdown
Contributor

@watson watson commented Mar 3, 2026

Summary

Optimizes the native/WASM loader in load.js so we only look for a WASM build when no native .node binary is found.

Changes

  • In load(), findWASM(name) is now called only when find(name) returns nothing. Previously both were always run, so when a native prebuild existed we still did the extra readdirSync and path logic for the WASM prebuilds folder. This removes that unnecessary work on the common path where a native binary is available.

Call findWASM only when find() returns no native .node, so we skip
unnecessary prebuilds readdir when a native build is available.
@watson watson requested review from a team as code owners March 3, 2026 09:11
Copy link
Copy Markdown
Contributor Author

watson commented Mar 3, 2026

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Overall package size

Self size: 37.28 MB
Deduped: 37.28 MB
No deduping: 37.28 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------|

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@szegedi szegedi merged commit 1c0d40b into main Mar 3, 2026
97 of 99 checks passed
@szegedi szegedi deleted the watson/perf branch March 3, 2026 10:25
tlhunter pushed a commit that referenced this pull request Mar 19, 2026
Call findWASM only when find() returns no native .node, so we skip
unnecessary prebuilds readdir when a native build is available.
tlhunter pushed a commit that referenced this pull request Mar 20, 2026
Call findWASM only when find() returns no native .node, so we skip
unnecessary prebuilds readdir when a native build is available.
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