Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: improve generate chunks #709

Merged
merged 2 commits into from
Nov 23, 2023
Merged

perf: improve generate chunks #709

merged 2 commits into from
Nov 23, 2023

Conversation

sorrycc
Copy link
Member

@sorrycc sorrycc commented Nov 23, 2023

image

Notes:

1、分别跑了 3 遍,m1 电脑上,yuyanAssets build 稳定提升 200ms 左右
2、比预期小,说明之前也是多核,但可能有对父进程的引用而导致有锁,改用 spawn 后,线程间改用传 chunk_id 的方式
3、产物中 js 总共 25M,入口文件 umi.js 6.8M,generate chunks 公共 9m,其中 non entry 和 entry 分别各占一半,可以看出 entry 部分没有利用多核,可优化空间较大,所以 #451 得继续做 cc @stormslowly

@stormslowly
Copy link
Member

如果某个 chunk 的生成失败了 ,这个错误调用者能拿到吗

@sorrycc
Copy link
Member Author

sorrycc commented Nov 23, 2023

加了出错处理了。

@sorrycc sorrycc merged commit 5190153 into master Nov 23, 2023
@delete-merged-branch delete-merged-branch bot deleted the sorrycc-ek9h branch November 23, 2023 06:20
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