What kind of data do you store? Have you considered using an alternative? I personally wouldn’t use it to store game data, but that’s just my opinion.
I haven’t compared this to profiling results on an actual device yet. It’s just that this halts the game for a brief moment and then continues, which is very noticeable, even in the editor.
@Suddoha we are reporting data to analytics, and storing the events that should be sent, in case the game is closed/crashes or there’s no network connectivity to deliver it at the moment. This is around ~ 11 kb of data (in this case).
Don’t use player preferences for that purpose.
Player preferences are intended for storing small amounts of data. Like preferences. Key bindings, graphics options, difficulty settings, etcetera.
That compares what? The speed of saving 10kb of data via player preferences vs via a file?
No, but I’m sure you’ll be able to make the comparison yourself and see that it’s much faster. As I said, player prefs are not intended for what you’re using them for.
There is plenty of documentation out there about data persistence.