We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
某个非典型项目,执行 umi setup,总耗时 1m6s,其中 1m1s 的时间都在做 deepClone。
注释掉这段代码的前后对比。
代码在 https://github.com/umijs/umi/blob/a278fad/packages/preset-umi/src/features/prepare/prepare.ts#L23 。
应该不需要做 deep clone。
The text was updated successfully, but these errors were encountered:
这里 clone 后续把 file.contents 删了,如果不 clone 的话,其他用 prepare 钩子的函数里这个 buildResult 参数里面就没有 contents 了,所以目测得想个其他的方法,另外 delete 其实也是比较耗性能的操作。
file.contents
buildResult
contents
delete
Sorry, something went wrong.
这部分的信息只有 mfsu 在用,可以直接用引用;删除 content 的初衷估计想尽快释放这部分的内存。如果一直挂在 appData 上相当于多存了一份代码。
yuyanAssets watch mode, 进入到 mako bundler 之前 delay 3s, mako bundler 反而能快个 2s 多,也是这个 deepClone 造成的
Successfully merging a pull request may close this issue.
Background
某个非典型项目,执行 umi setup,总耗时 1m6s,其中 1m1s 的时间都在做 deepClone。
注释掉这段代码的前后对比。
代码在 https://github.com/umijs/umi/blob/a278fad/packages/preset-umi/src/features/prepare/prepare.ts#L23 。
Proposal
应该不需要做 deep clone。
The text was updated successfully, but these errors were encountered: