Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug 2021.3 editor unusable, constantly performing search through 20000+ elements

Discussion in 'Editor & General Support' started by ebaender, Apr 20, 2022.

  1. ebaender

    ebaender

    Joined:
    Oct 29, 2020
    Posts:
    97


    So this is happening in all of my projects with every editor version since 2021.2.17f1, including the latest 2021.3 LTS release. It's basically unusable with roughly 50ms being taken up by this search operation. As a cherry on top the editor crashes on exiting in this state. I sent a bug report already, any ideas on a workaround for the time being?
     

    Attached Files:

    Last edited: Apr 20, 2022
  2. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Hi, I am trying to repro the issue. Do you have a project to share where I could investigate the issue? Otherwise, do you have a set of steps I could do in order to get into that state?
     
  3. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,993
    Just posted a duplicate thread a few minutes ago, then found this one. Pasting here my post for convenience, though it doesn't add much to what locquehardt already said:

    -------
    I'm an asset publisher, I sell several assets in the Asset Store. One of my users (that would be "locquehardt" above) recently brought to my attention a very strange behavior when importing one of my assets (which is a physics add-on, so mainly C# scripts).

    Immediately after importing the asset (no need to actually play a scene), the editor starts to behave in an unresponsive and sluggish way. Using the editor profiler reveals there's some kind of enumeration over +20000 elements happening every frame, amounting to 50 ms/frame even on empty scenes.



    The stack trace is:
    - Application.Tick()
    - Application.TickGlobalCallbacks()
    - EditorAppliaction.Internal_Invoke()
    - <Module>.Invoke_void()
    - BaseAsyncIEnumerableHandler.OnUpdate()
    - BaseAsyncIEnumerableHandler.FetchSome()
    - SearchEnumerator.NextItem()

    The user has only been able to reproduce this in Unity 2021.2.17f1 and above, I haven't been able to reproduce it in *any* Unity version.

    I've instructed the user in question to report this as a bug and send a repro project, but I'd still like to ask here: Any idea what might be causing this? Does anyone have encountered this before?
     
  4. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Ok thanks for the info. I will investigate this issue today and let you know what I find.

    Thanks for reporting.
     
  5. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,993
    Thanks! In case it is of any use, here's the original thread in the Obi support forums where this topic emerged. I'm user "josemendez":
    http://obi.virtualmethodstudio.com/forum/thread-3410.html

    That thread might contain useful info.
     
  6. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    On reason I see this could occur is a background search request being ran to do something, but from the callstack we can't tell what triggered it.
     
  7. arkano22

    arkano22

    Joined:
    Sep 20, 2012
    Posts:
    1,993
    That's what I though at first too, since the change log for 2021.2.17f1 shows several search-related changes/improvements. Also the name "SearchEnumerator.NextItem()" suggests this is search-related, thought the name could be a red herring.

    So far I've not been able to reproduce anything similar on my own, though. We only have locquehardt's report to work with.
     
    Last edited: Apr 20, 2022
  8. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    @locquehardt would you be able to share the list of packages you have installed in your project in case it is a 3rd party package that is running background queries. Normally the built-in Search module only runs queries if you have the Search Window opened.
     
  9. jonathans42

    jonathans42

    Unity Technologies

    Joined:
    Jan 25, 2018
    Posts:
    514
    Ok good news, after some testing and investigation this issue has been fixed in 22.2. I will backport the fix up to 21.3.
     
    MartinTilo and ebaender like this.
  10. ebaender

    ebaender

    Joined:
    Oct 29, 2020
    Posts:
    97
    Thanks for the help @jonathans42, good to hear it's being fixed!

    Sorry I wasn't able to respond earlier, do you still want the repro project? As for the list of packages, it's just Obi Fluid and the 2021.3.0f1 default packages. I didn't mention it because I thought that would just lead to the asset being blamed, and I talked with @arkano22 first to make sure it is not the cause.
     
  11. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,484
    From what I understand about the bug, I think a repro might not be necessary for the time being.

    You can follow the progress of the backport here and if you update to a version with the fix and if it still occurs then, then a new bug report with a repro project might be helpful :)
     
    ebaender and jonathans42 like this.