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

Added PooledBuffer to improve memory performance;Disable WebGL Blob to prevent listener multiple allocations #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

darklinden
Copy link

  • Added PooledBuffer to improve memory performance
    添加buffer池优化内存性能

目前在Editor/WebGL版本使用Profiler测试,buffer池足够可用时收发消息GC.Alloc稳定为0

  • Disable WebGL Blob to prevent listener multiple allocations
    WebGL中修改 instance.ws.binaryType = 'arraybuffer';强制使用arraybuffer而不是Blob来规避每次收消息new FileReader设置listener

Chrome performance中会发现稳定的listener的增加和一段时间后GC, 暂时强制使用arraybuffer进行规避

我这使用Unity2021.3版本测试WebGL build, 即使Profiler中GC.Alloc为0, 在Chrome performance中测试每帧也会有1kb左右的内存申请, 使用空工程导出WebGL build同上,暂无法处理

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.

1 participant