Search Unity

  1. Are you interested in providing feedback directly to Unity teams? Sign up to become a member of Unity Pulse, our new product feedback and research community.
    Dismiss Notice

Unity Import Activity Window (2021.2.0a19 and up)

Discussion in '2021.2 Beta' started by Unity_Javier, May 26, 2021.

  1. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Import Activity Window

    The Asset Database holds a lot of information about the state of your project which has not been available to users in the past. Being able to answer questions such as “why did my asset re-import”, or “how long did this asset take to import” are all questions that come up too often and a good answer is hard to get without investing some time into each individual situation. In order to improve this, we’ve created the Import Activity Window!


    Using this window, inspecting what the AssetDatabase knows about a particular asset in detail is now possible, and the possibility for a further self-diagnosis will be made possible.

    Accessing the Import Activity Window
    New window and context menus have been added to Unity that will allow you to use the Import Activity Window.

    Window -> Analysis -> Import Activity Window

    This will show the Import Activity window with the Overview for a project selected by default.




    Right Click on an Asset -> View in Import Activity Window




    Inspector Menu -> View in Import Activity Window



    Below are some of the main features of the Import Activity Window:

    Overview Panel



    The overview is meant to provide high level information on which assets either took the longest to import, or have the most dependencies. This will help to surface the most expensive items both for import time, but also as a way to verify which assets are susceptible to being reimported as their number of dependencies increases.

    Asset List
    The following information is available, in sortable columns:
    • See when assets were imported
    • Show how long it took to import each asset and sort by import duration
    • See which Importer was used to import a particular asset
    • Clicking an asset will then show the Asset Details panel, where you can see:
      • Its GUID
      • When it was imported
      • How long it took to import (and comparison to the previous import, if applicable)
      • Reasons for import
      • Produced files in the Library folder
      • A searchable & sortable list of dependencies



    There are many more features available within the window, and we look forward to hearing your feedback on it, and we're also happy to answer any questions you may have.
     
    Last edited: Jun 4, 2021
  2. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Bump!
     
    oxysofts, makaka-org and Aras like this.
  3. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    5,541
    It looks super interesting, but we're not in a position to try to update a big project that would need it right now.
     
    AcidArrow, Unity_Javier and Jes28 like this.
  4. Zarkend

    Zarkend

    Joined:
    May 11, 2016
    Posts:
    19
    Looks amazing to be honest :D
     
    Unity_Javier and Jes28 like this.
  5. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    622
    Would it possible to have this as a package, and use it in older (LTS) releases? Because this looks like a life saver.
     
  6. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    @TJHeuvel-net good question!
    We didn't make this a package on purpose because the internal data structures that it depends on are tied to the AssetDatabase and that's built into the Editor, so they're quite tightly coupled. The upside is that the window should "always" be compatible with whatever editor you're on (from 2021.2.0a19 onwards).

    However, if the demand is high enough we could do something with the Databases themselves, such that the Databases could be exported to an intermediary format which this window (or other tools) could then load, but there's no plans for that just yet.
     
    oxysofts, GliderGuy and TJHeuvel-net like this.
  7. IAndrewNovak

    IAndrewNovak

    Joined:
    Nov 29, 2013
    Posts:
    52
    Hello. I have some feedback.

    Would be nice to copy asset info fields (like GUID, Path, etc).
    Also, need more info about Duration 23 ms (-50%). It is not clear where this -50 % came from.
    I didn't find the option to hide Editor Assets from the Import Activity assets list.
     
  8. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Hey @IAndrewNovak!
    Thanks for the feedback.

    Sure thing, we can make those fields copyable :)

    The -50% comes from comparing the import duration to the previous import duration of that asset. I didn’t mention it in the original post because it was getting a bit long, but in the options dropdown you can enable “Show Previous Imports” and that will add a new list of imports to the window that you can browse :)

    Currently all Assets show up, but I guess you want to only see assets under the “Assets/“ folder? Might be good to have a toggle for showing package assets, so we don’t clutter the view.
     
    ccjay and mahdi_jeddi like this.
  9. IAndrewNovak

    IAndrewNovak

    Joined:
    Nov 29, 2013
    Posts:
    52
    Thanks for the reply.
    Yes. I want to only see assets under the “Assets/“ folder.
     
  10. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    191
    The reason is the most interesting part to me. Once the project reimported everything after we updated TextMeshPro package. Would've been interesting to see why Editor decided to do that.
     
  11. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,748
    My understanding is that whenever a new C# based asset postprocessor appears (or disappears), all assets are reimported. They kinda have to if you're going for 100% consistency (since asset postprocessor could potentially alter the imported result of any asset).

    Now, TextMeshPro does contain an asset postprocessor, I think (why, I don't know).

    That probably would explain it.
     
    Unity_Javier likes this.
  12. mahdi_jeddi

    mahdi_jeddi

    Joined:
    Jul 18, 2016
    Posts:
    191
    Makes sense, Possibly either had one and got removed or added one. It shouldn't have reimported everything, but I guess that's a limitation of the meta-data kept for imported assets to avoid reimporting them.
     
    XiWenbo likes this.
  13. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,976
    Is this information accessible via editor scripting API too?
     
  14. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Hi @Peter77,

    The APIs & the datastructures are marked as internal currently, so you could access them for testing with the right .asmdef, but we still kept them that way so that they can be changed, if necessary, before we make them public.
     
    Ruchir and mahdi_jeddi like this.
  15. Xelnath

    Xelnath

    Joined:
    Jan 31, 2015
    Posts:
    264
    Hi Javier, no offense to you directly, but Unity has along history of putting out cool tools that don't scale well and are super non performant.

    Can you set this up in a way that it doesn't take forever to load the screen, handles 120,000 assets gracefully (NO MASSIVE SCROLL BARS), doesn't memory alloc the entire application to death and repaints efficiently?
     
    Ramobo and nilserik like this.
  16. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    212
    I'd organize it by folder, at least when ordering by name.

    Using UI Toolkit for everything (not just *some* things) and virtualizing the asset list should do it. Hell, it seems that most leaf nodes in this window are `IMGUIContainer`s. There should be misleading advertisement penalties for companies that don't use their own products.
     
    Ruchir likes this.
  17. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    7,243
    IMGUIContainer
    is a unity "product"...
     
  18. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    212
    Is that a joke that I don't get? The quotes make it seem so.
     
  19. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    7,243
    No joke. There is no meaning behind what you said. They are using a unity made tool on a way they intended it. IMGUIContainer is a tool in a big, complex set of tools which allows us (and them) to use code made a while ago play along with the new system while everyone rewrite their systems to use the new one. It's software engineering 101. You don't migrate everything at once, especially not in a complex software like unity. But you already know all of this, why do I have to spell this out?
     
    Last edited: Jun 5, 2021
  20. Ramobo

    Ramobo

    Joined:
    Dec 26, 2018
    Posts:
    212
    UI Elements was added as experimental in 2017.1 and released in 2019.1, it seems. If they've updated their Mono fork in a few months, they can rewrite the Console window with UI Toolkit in 2 years. Different teams, but you get the idea. Console, Project, Hierarchy, Game, Lighting... all still pure IMGUI. The longer they keep piling changes up on the old codebase, the worse an eventual rewrite gets.

    I'm sure that you get the sentiment: Acme releases this product that's gonna fix everything and it's utterly broken because they haven't felt the pain of using it for any serious project.
     
    Last edited: Jun 5, 2021
  21. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Hi @Xelnath ,
    Thanks for the feedback.

    I had originally profiled the opening of the window using a 200,000 file project but it appears that something has regressed. I'll improve the loading time, and I'm currently exploring some approaches:
    1. Return a smaller list (i.e. a % of total assets initially or first 100 items, for example), then have a button for "load remaining assets" or something to that effect.
    2. Make the sorting faster when opening the window. I've verified this to be the biggest bottleneck on a project with 900,000 files. With #1 this might be less of an issue, but if all assets do get loaded, sorting by path, import time, duration, etc. would still be slow so there's something to explore there.

    doesn't memory alloc the entire application to death
    Will also have a look at what can be done there. I've read some of the replies to the thread and there's some ideas there, so I'll keep my eyes open for it :)
     
    stuksgens, ccjay, mariandev and 2 others like this.
  22. Unity_Javier

    Unity_Javier

    Unity Technologies

    Joined:
    Mar 7, 2018
    Posts:
    89
    Hi @Ramobo,

    So, the main issue is that parts of UIToolkit are in a package, and other parts are not. This means that for certain features I can rely on UIToolkit, while for others I have to use IMGUI as you've pointed out (the search field being another problematic area). Its a sort of catch-22, because UIToolkit benefits from a "faster" release cycle by being in a package, but we don't have access to it all in the editor, though this is incrementally getting addressed.

    Earlier in the thread its been noted that a package could be made for this, but that introduces a number of other dependencies and potential for incompatibility with different releases and versions of the editor.

    That being said, I'll double check IMGUI to see if something can be done about the tree views (caching of elements, improved code path, etc.) to see if I can decrease the repaint cost of the visible list.

    Hope that helps to shed some light into some of the decisions we made along the way!
    Thanks for the feedback so far, it helps to figure out if the priorities are in the right place. :)
     
    Wattosan, ccjay, mariandev and 6 others like this.
  23. dlorddd

    dlorddd

    Joined:
    Aug 13, 2016
    Posts:
    6
    Hi @Unity_Javier ,
    this new feature looks great. I could not try it out yet but I am curious to ask the following:
    Does the Import Activity Window highlight any activity that is related to Unity Accelerator (upload to, download from, etc.)? It would be a great benefit once we upgrade our project to stable 2021.2 in the future.
     
    codestage likes this.
  24. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    777
    Hi Javier, some more feedback after trying this out:

    - some filenames (e.g. all package.json imports) are truncated in the middle, and only show the path on hover. There's more than enough space.

    upload_2021-6-22_23-18-21.png

    - especially the dependencies list could benefit from another splitter, there's tons of space and a tiny window to scroll through them right now

    upload_2021-6-22_23-19-50.png

    - would be great if "SourceAsset/MetaFileHash/xxx", "SourceAsset/HashOfSourceAssetByGUID/xxx" and the actual source asset would be grouped (or these typical things in a foldout) - hard to see what belongs to what otherwise

    - right now it seems the _actual_ import time isn't visible, e.g. when you have URP in the project there's
    - "Decal.shadergraph" which takes 130ms and has 195 dependencies
    - "SpeedTree8_PBRLit.shadergraph" which takes 7120 (!) ms and has 222 dependencies
    I can only assume the bulk of that import time is the shader compilation but I'm not sure.
    A similar issue for e.g. "Mono.Cecil.Pdb.dll" (1885ms) and "Newtonsoft.Json.dll" (1033ms) where I can't actually see the reason why these take so long – if it's possible to show more there that would be great.

    - for Custom Dependencies it would be great if their current value and the value on import would be visible
    upload_2021-6-22_23-25-15.png

    Otherwise I agree with other voices here that performance would probably benefit from VisualElements, and that some hierarchical view would be great as well. Thanks for a great tool, please keep improving it :)
     
unityunity