steamvr_unity_plugin icon indicating copy to clipboard operation
steamvr_unity_plugin copied to clipboard

ScanForPartials causes files to get reimported + generates a lot of garbage collection

Open IchiSumeragi opened this issue 4 years ago • 4 comments

ScanForPartials() (SteamVR_Input_ActionManifest_Manager.cs - line 812) triggers a reimport of some files and around 40mb of garbage collection in our case every time we save, causing the save to slow down drastically (adding around 7 to 8 seconds every time).

I suspect this is due to the method opening Jsons, causing them to get reimported in the process.

image

IchiSumeragi avatar Apr 08 '21 13:04 IchiSumeragi

Thanks for the report, we'll take a look at getting this fixed.

keithbradner avatar Apr 08 '21 21:04 keithbradner

I don't think opening the JSONs should be causing that much garbage. Though I have noticed significant slowdowns with saving other projects (without VR) that have a lot of assets. The best I can recommend is updating your version of Unity

keithbradner avatar Apr 27 '21 21:04 keithbradner

I've dug a little more with some deep profiling : this is indeed not caused by opening the JSONs but rather caused by the Directory.GetFiles call at line 814 (first line of ScanForPartials).

image

I have never used this function myself, but by the looks of it in this case, it'll dig up every folder from Application.dataPath (so, the entire project in this case?) in search for the partial manifest, which would explain why the impact is worse in bigger projects.

A solution could be if the plugin could allow us to either point to them/a folder containing the partials, or bypass the check if we are not using them ? I don't know what they do (we're not using them), so I'm not sure how viable either of these solutions are.

IchiSumeragi avatar Apr 29 '21 12:04 IchiSumeragi

Thanks for looking into that further, I'll see what we can do about that.

keithbradner avatar May 03 '21 18:05 keithbradner