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

Asset DB v2: Importing unchanged assets hangs editor (no forced update)

Discussion in '2019.3 Beta' started by spaceemotion, Dec 26, 2019.

  1. spaceemotion

    spaceemotion

    Joined:
    Sep 29, 2015
    Posts:
    95
    I'm currently updating to 2019.3f3 and am experiencing periodic freezes (around 700ms) with the AssetDatabase v2 refresh, according to the profiler.

    Based on the information, I've already removed the PolyBrush package, but the lag-spikes are still there (and very noticable) even now that they're down to 450ms.

    In case it helps, I've uploaded the before and after profiling .data files as a zip: https://d.dyonity.com/M757Yr

    For the freeze to happen I don't have to do anything, just having the editor open flashes the cursor to the "waiting circle" every couple seconds or so.

    upload_2019-12-26_14-53-40.png

    For my hardware configuration: CPU is the Threadripper 2950x (16 cores), Unity is running off of an NVMe SSD, the project is on a Samsung 860 evo.

    Edit: I've also tried disabling the "Auto Refresh" setting ( see https://docs.unity3d.com/Manual/Preferences.html#General). It still tries to call the refresh method, would that be considered a bug, or am I missing something?)

    ---

    Edit 2: I've done a Deep Profile and figured out that FMOD for Unity is doing the refresh every 5 seconds, which hangs the editor. It looks like it tries to call the "ImportAsset" method, but without forcing an update. Which, in theory, should skip the import if it's already imported (as far as I understand the import options).
    Profiler Dump (1gb): https://d.dyonity.com/mjvqMT
     
    Last edited: Dec 27, 2019
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    They're aware of some AssetDatabase slowdowns, such as this one:
    https://issuetracker.unity3d.com/issues/focusing-the-editor-window-causes-noticeable-slowdowns

    However, I hear for the first time of these periodic freezes. Therefore I think it would be worth to submit a bug-report for this issue. If you're able to reproduce the issue, please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  3. spaceemotion

    spaceemotion

    Joined:
    Sep 29, 2015
    Posts:
    95
    First of: thank you for taking the time to give a detailed way to do bug reports (I've done a couple in the past)!
    However, there are two parts to this post that I can answer by now:

    1. The periodic refresh happens because of a bug in the FMOD Studio plugin for Unity (there was a forum post about it on their side and they already fixed it on master)
    2. A question about why unity needs to reimport unchanged files.

    While I was able to fix the former, the link you've provided, answered the latter; it's not on their roadmap quite yet (quote: "ImportAndPostProcessAssets currently there's no scheduled improvement for it, but we might be able to skip it completely if we detect there's no changes to scrips, settings & postprocessed assets.")

    For the time being I've adjusted the thread title to reflect these latest developments. I guess for now it's just wait and see.
     
    Peter77 likes this.
  4. God-at-play

    God-at-play

    Joined:
    Nov 3, 2006
    Posts:
    330
    Thanks so much for reporting this, I was also able to determine my hanging was due to FMOD, just kind of by "feel" as it were. Removing the build or project path in their settings stopped the hanging. It's basically a showstopper bug. Is there any workaround at this time? This is a really serious problem.
     
  5. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    For me, the solution was to just not use v2. It is simply slower and clunkier than v1 in its current state.
     
  6. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    80
    How do you switch to v1? I don't see the option to switch, it only shows v2.
     
  7. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Under Editor / Asset Pipeline / Mode:


    If Unity has gone 100% insane and not allowed to switch back (something that would usually be absolutely impossible to believe, but Unity has had a bad history of handling deprecation), then you should be able to switch by changing a value in the settings file (ProjectSettings/EditorSettings.asset). Simply change the "m_AssetPipelineMode" value from 1 to 0 and restart unity. :)
     
  8. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    80
    Thanks for the tip! Unfortunately I think this is no longer possible :(

    upload_2020-8-17_2-2-8.png

    I've tried updating "m_AssetPipelineMode" and restarting Unity, but I think the current version just ignores that option. I had the same AssetDatabase.Refresh() modal afterwards.

    May I ask what version of Unity are you changing this on?
     
    yunjuanhuakai likes this.
  9. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    That's... insanity. I personally can't even open my project with Asset Pipeline v2, it just freezes forever. Why would unity *force* developers to use this way too new feature??

    I'm using 2019.4.3f1
     
    yunjuanhuakai likes this.