Added PooledBuffer to improve memory performance;Disable WebGL Blob to prevent listener multiple allocations#36
Merged
Conversation
fix: Disable WebGL Blob to prevent listener multiple allocations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加buffer池优化内存性能
目前在Editor/WebGL版本使用Profiler测试,buffer池足够可用时收发消息GC.Alloc稳定为0
WebGL中修改
instance.ws.binaryType = 'arraybuffer';强制使用arraybuffer而不是Blob来规避每次收消息new FileReader设置listenerChrome performance中会发现稳定的listener的增加和一段时间后GC, 暂时强制使用arraybuffer进行规避
我这使用Unity2021.3版本测试WebGL build, 即使Profiler中GC.Alloc为0, 在Chrome performance中测试每帧也会有1kb左右的内存申请, 使用空工程导出WebGL build同上,暂无法处理