Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved Editing Addressable prefabs is slow (Addressables v1.16.15, Unity 2019.4.1.f1)

Discussion in 'Addressables' started by yuch3n, Feb 9, 2021.

  1. yuch3n

    yuch3n

    Joined:
    Sep 26, 2018
    Posts:
    26
    Whenever I open a prefab that's been marked as Addressable and make any change to a field in the Inspector, the Editor beachballs for a long time. This makes editing prefabs very slow and painful. If I want to change the position a piece of UI, for example, I have to wait however long it takes for whatever the Addressables system is doing in the background x # operations needed to edit the prefab (which can be a lot if I need to change anchor position, pivot, alignment etc). I think this is because prefabs autosave any changes you try to make. I haven't been able to find a way to turn this feature off.

    I can work around it by dragging the prefab into a scene, making the changes, then applying, but I'd much rather be able to edit the prefab directly. Sometimes the apply button messes up the transforms of the prefab, particularly if it's UI.

    Another workaround is to unmark it as Addressable, do the edits, then remark it as Addressable. But it becomes tedious having to record the address and the Addressable Group the asset is from, make my changes, and mark it as addressable, paste the address back in, and then drag it back into the right Addressable Group.

    Is there some better way of getting around this? What is causing changes to addressable prefabs to be so slow?
     
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,796
    I'll kick this over to the team for some guidance.
     
    yuch3n likes this.
  3. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    736
    This is the first I've heard of such an egregious performance issue when editing prefabs. Sounds very painful though. Would you mind submitting a bug and attaching your project to it so we can have that to reproduce? We're working to improve performance across the board so it sounds like this is another piece in that story.
     
    yuch3n likes this.
  4. yuch3n

    yuch3n

    Joined:
    Sep 26, 2018
    Posts:
    26
    I unfortunately can't attach the project as it's proprietary. I tried creating a sample project but I think the performance issue can only be seen in a large project with many assets. However, I managed to do some profiling and I found this was happening every time I made a change to an Addressable prefab.

    Screen Shot 2021-02-11 at 2.27.03 PM.png

    As you can see, the ExecuteAll call took quite a long time. I enabled Deep Profile and found that something in the asset system was doing a lot of string operations on asset labels (3 lines above the highlighted function you can see "ParseMetadataFromAssetLabels").

    Screen Shot 2021-02-11 at 2.33.39 PM.png

    It also spent some time reading manifests, which, to my limited knowledge, has something to do with Addressables.

    Screen Shot 2021-02-11 at 2.34.25 PM.png

    And calling something that finds all assets. Another expensive call.

    Screen Shot 2021-02-11 at 2.34.55 PM.png

    Screen Shot 2021-02-11 at 2.35.19 PM.png

    And this is happening only on Addressable marked prefabs.
     
  5. pillakirsten

    pillakirsten

    Unity Technologies

    Joined:
    May 22, 2019
    Posts:
    346
    The call stack looks like a deeper engine issue that the asset database team might need to look at. Please submit a bug with the profiler screenshots, so that QA can process the issue and send it to the right team.
     
  6. yuch3n

    yuch3n

    Joined:
    Sep 26, 2018
    Posts:
    26
    Sent them a bug report. Thanks.

    Also, for anyone else that also has this problem, I found an older thread from 2020 that seems to have the exact same problem (not sure if they're also using Addressables), and they found another good workaround. When you open a prefab, there's another Autosave option, separate from the one in Preferences, that you can disable. It is located here. Disable that, and it will no longer save and trigger the asset reimport issues every time you make a change.

    Screen Shot 2021-02-22 at 4.34.37 PM.png

    This isn't a solution to the main problem, which is that modifying one singular prefab causes a reimport of all prefabs, but it will at least reduce the problem to only having to do it once when you decide to save your changes.
     
  7. yuch3n

    yuch3n

    Joined:
    Sep 26, 2018
    Posts:
    26
    The issue seems to be resolved in Unity 2019.4.19f1. I no longer get the beach ball even when I have Autosave turned on. :D