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

您好,请问您的wasm-split分包功能是否有wasm函数个数或者包体积的限制? #2

Closed
yangtianrui95 opened this issue Jan 3, 2025 · 1 comment

Comments

@yangtianrui95
Copy link

使用开发者工具分包会不会触发WASM Import 函数个数超过10W的限制,我们这的wasm文件体积大函数多,我之前在别的平台使用wasm分包会有这个问题。
报错如下:
image

这个问题的原因是因为wasm-split会把分包的函数移动到到主包的Import模块中变成一个placeholder函数,而wasm引擎中Import模块的函数个数存在限制,如果此时分包函数过多插入主包中会触发上面的限制导致wasm实例化失败。

查了下最近标准import函数限制应该是改成100W了,但是目前除了最新的v8 13的版本仍然有问题,请问小米小游戏有这个限制吗 ?

WebAssembly/design#1520

@houqingfeng
Copy link
Owner

包体积没有限制,如果过大,可以把资源放在cdn上加载。10W的函数限制是存在的,我们也在解决这个问题。wasm如果在40M以内,建议可以不用分包

@yangtianrui95 yangtianrui95 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2025
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

No branches or pull requests

2 participants