Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

(Case 1290128) [Android] Resources.LoadAll slow when (LZ4/LZ4HC) compression is applied

Discussion in '2020.2 Beta' started by kleicht, Nov 4, 2020.

  1. kleicht

    kleicht

    Joined:
    Aug 1, 2018
    Posts:
    16
    I'm trying to load text assets from Resources folder with Resources.LoadAll<TextAsset>() method.
    In version 2020.2.0b9.3373 it became more then 10 times slower compared to 2020.1.11f1 if either LZ4 or LZ4HC compression is applied to the build.
    It gets increasingly worse if other packages/plugins create assets under resources folder. So more than likely it has to do something with resources folder size.

    Folder A
    byte asset size: 131072 byte
    byte asset count: 1
    Folder B
    text asset size: 256 byte
    text asset count: 600

    Reading text files only from folder B.
    (Version / Compression method / time )

    2020.1.11f1 DEF 167 ms
    2020.1.11f1 LZ4 140 ms
    2020.1.11f1 LZ4HC 155 ms

    2020.2.0b9.3373 DEF 66 ms
    2020.2.0b9.3373 LZ4 2100 ms
    2020.2.0b9.3373 LZ4HC 1911 ms
     
    Peter77 likes this.
  2. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    900
    I would strongly advise you to follow Unity's published best practices for this as shown in their whitepapers and on their tutorials site:


    ... if that's possible in your scenario.