PlayerPrefs Set() vs. Save()

I had a quick question about PlayerPrefs, which I feel was not clarified in the docs.

Does the Set function, e.g. SetInt(), SetFloat(), actually save the data to the variable associated to the key in the stored PlayerPrefs file/disk, or does it just temporarily change the variable, and then I have to call Save() right after to fully save to the PlayerPrefs file/disk?

I assume Save() is an end all, be all, Save function that writes every key and its variable to the PlayerPrefs file/disk. I was just wondering if the Set() is the same thing, but for an individual key and its associated variable.

No, otherwise there’d be no need for a Save() function. As far as I know, all PlayerPrefs data is read and cached up front. When you modify it or refer to it, it is the cache that is being used, not the file store. If you modify the cache you need to tell it to write back. The idea is that if you want to make a bunch of changes you should do that to the cache, then write it all to disk at once.

I think it’s worth mentioning that PlayerPrefs.Save() does not need to be called, ever. This is because unity automatically calls it on application quit. This method is only necessary if you are unsure if your game will crash or not.