Saving deterministic project files

Is there some fundamental reason why the ordering of elements in the project files gets shuffled each time the project is saved?

I suspect it’s just an implementation detail of them being output in the (randomised) order they are stored in hashes - but if so would it be stupidly expensive to sort them in some way?

It would be really nice to be able to diff two project files and clearly see just the changes that happened between them, but right now if you do that you generally get a huge diff full of elements that didn’t actually change just being in a different order in the project file.

(Mentioning this here now, because the project I hit the rotoscoping bug in is far too huge to reasonably share here - but if I could have diffed the project files I could have quite easily pasted the difference between what 24.05.0 and 24.02.2 created for the copy of that clip/effect).