Cause and mechanism
An AssetBundle packages assets such as textures and Prefabs for loading. LZMA decompresses the bundle's full stream; LZ4 can decompress needed chunks. Asynchronous loading can still have spikes, so measure decompression and asset creation separately. Do not assume every LZMA decompression operation runs entirely on the main thread.
Check and correct the setup
- Check group compression and measure first downloads separately from cached loads.
Release / Dispose - Compare LZ4 for local access while considering download size and disk use.
Release / Dispose - Profile asset creation, GPU uploads, and activation separately; preload and bound concurrency.
Release / Dispose
Limits and verification
Unity caching can recompress downloaded bundles to LZ4. WebGL AssetBundles do not support LZMA; use LZ4.
A focused diagnostic setup
Measure first acquisition, cached loading and asset instantiation separately. Network waiting and frame stalls are different metrics.
Test in this order
- Record compression/cache state, stage time and peak memory.
Release / Dispose - Compare LZ4 with matching contents, bundle granularity and concurrency.
Release / Dispose - Separate instantiation/GPU upload and test preloading.
Release / Dispose
Interpret the result
Remaining instantiation stalls after faster cached loading point beyond compression. Balance transfer size, storage, peak memory and frame cost.