RandyKnapp / Auga

48 stars 16 forks source link

Auga API IsLoaded performance #155

Open MSchmoecker opened 1 year ago

MSchmoecker commented 1 year ago

When adding compatibility for Auga to a mod, calling Auga.API.IsLoaded() is really heavy. It is calling AppDomain.CurrentDomain.GetAssemblies() in the background which gets slower the more mods are loaded. Especially if Auga isn't installed, the whole list will be iterated completely.

Depending on the changes for Auga compatibility needed, this IsLoaded check may be called quite often (Update for example) and it isn't clear or expected that this call would be heavy.

I propose to use the BepInEx Chainloader for this check, as it is only a dictionary lookup.