I noticed that on a scene with large number of savers, performance can drop significantly when adding additional savers - in my case when a new object is spawned. This is caused by calling Contains method on a List here:
public static void RegisterSaver(Saver saver)
{
if (saver == null || m_savers.Contains(saver)) return;
m_savers.Add(saver);
}
This could be improved a lot if HashSet was used instead of a List. I attached rough implementation for you evaluation.
Improving saver registration performance
Improving saver registration performance
- Attachments
-
- SaveSystem.zip
- (6.61 KiB) Downloaded 438 times
Re: Improving saver registration performance
Hi,
That sounds like a good optimization. I'll get it into the next release. Thanks for the suggestion!
That sounds like a good optimization. I'll get it into the next release. Thanks for the suggestion!