Unity: FMOD Reference Updater takes 15minutes to scan

Hi all!

I have a question regarding the speed of FMOD Reference Updater. In our Unity editor, it’s taking incredibly long to scan - 15min in average. Is there a way to speed this up?

I would like to give you more info, but apart from unity scanning every single prefab, item, down to the last corner of the project, I don’t know what else to share with you. Does anyone have any experience with this?

Thank you. :slight_smile:

15 minutes? That sounds wild. I don’t have much experience, but:

Having the project on an SSD or removing unused scenes from your Unity project’s Assets folder should improve scan times.

As a reference for quick it can take, it takes around 40 seconds to scan 64 scenes in my Unity 2D project on my SSD, and 5 seconds to scan the rest (including 313 prefabs). I have a reasonably new gaming laptop.

Hi,

Thanks for reporting the issue - 15 minutes definitely seems out of the ordinary unless your project is absolutely massive. I’ll do some testing on my end and see whether there’s anything that can be improved, but for reference, can I get you to run the following lines of code to count the assets that the EventReferenceUpdater scans, and provide me with the results?

string[] searchFolders = { "Assets" };

int totalPrefabs = AssetDatabase.FindAssets("t:GameObject", searchFolders).Length;
int totalScenes = AssetDatabase.FindAssets("t:Scene", searchFolders).Length;
int totalScriptableObjects =
    AssetDatabase.FindAssets("t:ScriptableObject", searchFolders).Distinct().ToArray().Length;

Debug.Log("Scanned asset counts:" +
    "\nPrefab count = " + totalPrefabs +
    "\nScene count = " + totalScenes +
    "\nScriptable Object count = " + totalScriptableObjects
);

Just following up on this; were you able to get around to running the code snippet I posted previously? If not, please give that a shot see what kind of numbers it comes up with for your project.

For now though, I’ve flagged some improvements internally around allowing the scope and specificity of the reference updater’s scan to be changed - for example, toggling whether specific asset types are to be scanned for (GameObject/Scene/ScriptableObjects), and specifying the directories in the asset structure to be scanned instead of scanning the entirety of the Assets folder.

Sorry, Leah, I just now noticed your replies. I will forward this to my team and get back to you.

1 Like

No problem, please get back to me when you’re able to!

Hi Leah, I finally found time to get back to you. :expressionless:

So, our developer ran your test, and we got this:

Scanned asset counts:
Prefab count = 1661
Scene count = 7
Scriptable Object count = 2656

Our developer’s guess on this is that the problem probably doesn’t lie in the number of assets, just the “method” is slow. To him, it looks like it’s threaded but not exactly optimal. This section (posted below) seems to be the bottleneck.

return SearchPrefabs(prefabGuids)
                .Concat(SearchScriptableObjects(scriptableObjectGuids))
                .Concat(SearchScenes(sceneGuids))
                .GetEnumerator();

In his words: “It seems to be building up the structure as it goes, but it would be better to come up with a “smarter” way of “find and replace.” Is this process even multithreaded?” (Of course, you can also talk to our developer, he would be happy to chat with you.)

If you need any additional info from us, let me know. Anything to help us reduce the lengthy scans. :slight_smile:

Best regards!

Thanks for the numbers, Jaka - I’ll do some testing on my end, talk with the development team about this, and get back to you.

1 Like

Thank you so much, looking forward to hearing from you!

After talking with the development team, given the fact that the 15 minute scan you’re observing is such an outlier to the experience reported by other users, we’d like to do some testing specifically with your project to take a closer look into what exactly is going on.

If possible, could I get you to privately share the Unity project, or a stripped down version where you can still reproduce the extremely long scan, with me? You can do so via your FMOD User Profile.

Just following up on this again - I responded to your DM, but I’m not sure whether you’ve seen my response. Please feel free to send an email to support@fmod.com and link this thread, and we can go from there.