Hi Javier,
Sure, happy to help where I can
Our project has quite a lot of heavy textures. I’m curious as to what impact it could have. I’m guessing it shouldn’t matter for script compilation and reloading, but could impact the 1.4 sec spent in AssetDatabase.V2.PostProcessAllAssets?
I’m guessing our project is also rather script heavy, I don’t know what’s a normal amount of script. I’m also not sure what proportions of scripts are from packages like Entities versus our own project.
I saw that unity 2019.3f1 was released over night so I switched to it. It seems to be a little faster (around 8 seconds). Or it could be due to a change my method of testing or environnement, I’m not sure. If you need I can send another profile.
The script you provided ran with an error:
NullReferenceException: Object reference not set to an instance of an object
AssetDistribution.GetAssetDistribution () (at Assets/Editor/AssetsDistribution.cs:18)
By stepping in with the debugger I found that AssetImporter.GetAtPath() returns null for one of the paths: “Packages/com.unity.entities/Unity.Entities.Editor/Mode/default.mode”
So I added a null-check
var curImporter = AssetImporter.GetAtPath(assetPath);
if (curImporter == null) {
Debug.LogWarning($"No importer for asset at path {assetPath}");
continue;
}
Here is what the script logged:
UnityEditor.AssetImporter,971
UnityEditor.MonoImporter,2675
UnityEditor.PrefabImporter,85
UnityEditor.TextureImporter,921
UnityEditor.TrueTypeFontImporter,27
UnityEditor.TextScriptImporter,93
UnityEditor.ShaderImporter,102
UnityEditor.ModelImporter,9
Unity.VectorGraphics.Editor.SVGImporter,8
UnityEditorInternal.PackageManifestImporter,56
UnityEditorInternal.AssemblyDefinitionImporter,109
UnityEditor.StyleSheets.StyleSheetImporter,24
UnityEditor.PluginImporter,11
Unity.Build.BuildPipelineScriptedImporter,2
UnityEditor.UIElements.UIElementsViewImporter,11
UnityEditor.AudioImporter,10
UnityEditorInternal.AssemblyDefinitionReferenceImporter,1
Total assets: 5116
UnityEngine.Debug:Log(Object)
AssetDistribution:GetAssetDistribution() (at Assets/Editor/AssetsDistribution.cs:40)
I didn’t make a bug report right away, because I wasn’t sure if this would be treated like a bug, and reporting bug has proven quite time consuming for me in the past. Also our project is pretty big, would it still be useful for you if I made a bug report without attaching all of the project somehow (project might be in a broken state then) ?