Search Unity

LZ4 compression chunks and memory usage

Discussion in 'Asset Bundles' started by crazymonkay, Feb 8, 2020.

  1. crazymonkay

    crazymonkay

    Joined:
    Apr 1, 2013
    Posts:
    113
    Hello all,

    Unity's documentation about the LZ4 compression method describes it as "chunk-based compression", where only the needed "chunks" of an asset bundle are decompressed when an asset is loaded.

    I am curious about how small these chunks are. For any arbitrary object, is the chunk only made up of the assets that the object uses (meshes, materials, textures, etc)? Or is it possible that a chunk may contain assets for multiple objects that are not related to each other? I did some quick testing with the profiler and it looks like the first option is the case, at least for the objects I tested with.

    The main reason I am curious is because I am wondering if there are any benefits to breaking up assets into smaller bundles versus putting large amounts of assets into a single bundle when LZ4 is used. In my case I have built a level editor where there are a large number of assets that can be chosen basically at random.

    Thanks!
     
    Last edited: Feb 8, 2020
unityunity