Search Unity

Slow build times when adding ScriptedImporter object.

Discussion in 'Addressables' started by j_hansen, Jun 11, 2019.

  1. j_hansen

    j_hansen

    Joined:
    Oct 13, 2017
    Posts:
    3
    Hi,

    We are in the process of converting a project over to Addressables, but are experiencing long Addressables build times.

    I have boiled the problem down to the combination of:
    * a custom texture atlas importer.
    * a custom level importer using ScriptedImporter.

    In the small example project there is a single Texture2D containing 400 sprites, and a level containing 1000
    SpriteRenderers.
    On my machine it takes around 1 minutes to generate two bundles, one is ~50k and the other ~170k

    I have tried to figure out whats going on, and it looks like it's calculating the hashes that takes time, it loops over each of the 400 images for each sprite in the level.

    Is there something we can do to speed up the build? when having 100+ levels, it takes more than an hour to just build the bundles :/

    Example project:
    https://github.com/bithorder/unity_slow_addressables_build