Figure: Diagnostic workflow: Measure I/O/decompression → Choose compression/cache → Compare first/repeated loads
Figure: Diagnostic workflow: Measure I/O/decompression → Choose compression/cache → Compare first/repeated loads

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

  1. Check group compression and measure first downloads separately from cached loads.
    Release / Dispose
    Release / Dispose
  2. Compare LZ4 for local access while considering download size and disk use.
    Release / Dispose
    Release / Dispose
  3. Profile asset creation, GPU uploads, and activation separately; preload and bound concurrency.
    Release / Dispose
    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

  1. Record compression/cache state, stage time and peak memory.
    Release / Dispose
    Release / Dispose
  2. Compare LZ4 with matching contents, bundle granularity and concurrency.
    Release / Dispose
    Release / Dispose
  3. Separate instantiation/GPU upload and test preloading.
    Release / Dispose
    Release / Dispose

Interpret the result

Remaining instantiation stalls after faster cached loading point beyond compression. Balance transfer size, storage, peak memory and frame cost.

Related explanations

References