Anything we can do to bump up the speed of decompression of asset bundles (or downloading for that matter) in webgl? Similar to setting the thread priority in webplayer builds?
I agree.
The downloading using WebGL is really slow, maybe we can add a loading status bar so players know when its ready.
WebGL is single threaded, so something like threadPriority does not make sense with the current set up. Downloading is restricted by bandwidth, not much we can change here.
Since WebGL is single threaded, decompression will only happen when the download is completed, and it will be blocking. Adding to that, LZMA (the compression used in our AssetBundle system) cannot be very efficiently decompressed in JavaScript. So decompressing of AssetBundles blocking the main thread is a real issue in WebGL.
One thing you can do to improve the situation is to build your AssetBundles as uncompressed (BuildAssetBundleOptions.UncompressedAssetBundle). Then, you set up your web server to serve those files using gzip compression. That way, decompression is done by the browser on the http transfer level, and Unity does not need to block do decompress. But you will sacrifice some compression density, because LZMA compresses better then gzip. So essentially, you trade blocking time when decompressing the AssetBundle for AssetBundle download time.
This thread is about downloading AssetBundles, not the main game data (which should display a progress bar by default).
@jonas-echterhoff_1 Ya, that was the reply/insight i was looking for, thanks. We are currently downloading 1 bundle at a time, even when we know we need to wait for 3. Do you have any insight on if this is a better / worse strategy on WebGL? We could start them all at once, but from my understanding it’s not clear that would use http bandwidth any better…
Http bandwidth usage would probably the same in either cases. One potential benefit of simultaneous downloads would be that the other downloads would be in flight while one finished download decompresses, so you would not have idle time.
good point. we will experiment.