- Home /
Does anyone know why continuously saving to playerprefs would cause a performance drop ?
hello all I am working on a project right now and in order to save we serialize a large prefab to JSON and then store this prefab in player prefs .
Along side this we are saving audio files in bytes to the users storage separately and then upon loading bringing all of our saved data together at once . Loading doesn't seem to cause a performance drop but saving definitely does after repeated instances of saving data .
So my question is has anyone had an experience where repeatedly saving data to playerprefs has caused the frame rate of the app in general to slow to a crawl ? It's more of a gradual degradation after we continue saving repeatedly and when we store this data it is taking us from a solid 60 FPS to 17fps after 12 or so saves.
At one point we were saving all our data in the object then serializing the entire object and saving that to playerprefs. This would cause 2 minute load times when we saved to all slots so we eventually broke the save data out into individual playerprefs keys and this helped a ton .
I tried running the garbage collector but it didn't seem to be helping much once we recorded crashes and FPS trends , are there any other suggestions on why our save is slowly wearing down our fame rate ?
just to give a little more insight one playerprefs save that we are producing creates roughly 4mb's of data for every 30 seconds of data we recorded .
Your answer
Follow this Question
Related Questions
Serialize game objects in Unity~ 1 Answer
Saving players progress in ScriptableObject asset 1 Answer
whats the best way to save a large list of variables? 1 Answer
How to add strings in a list AND be able to save it and load it? Using playerpref OR serialization 2 Answers
How can I save a series of instantiated objects from an array? 2 Answers