Stanzilla / WoWUIBugs

World of Warcraft UI Bug Tracker
153 stars 7 forks source link

SavedVariables are looking rather flat in 10.2.7 #549

Closed Meorawr closed 1 month ago

Meorawr commented 2 months ago

In 10.2.7.54253 saved variables files are being written without any indentation at all when it comes to table contents.

DFortun81 commented 1 month ago

This isn't a regression and here's why: https://us.forums.blizzard.com/en/wow/t/option-to-compress-savedvariables/1752911/46

The removal of extraneous characters (indenting, comment indexing for arrays, etc) in the SavedVariable files significantly decreased the loading times for the primary use case. (IE: Players) There are some situations where having human readable saved variable code is useful, but for the vast majority, this extra detail in the files provides nothing but increased load and reload times. As such, this is not a regression at all, in fact, its a boost to the entire player base by removing something so simple and meaningless to most of them.

In that thread I did express the desire to opt in to indenting. (Such as when an addon developer needs to see the human readable format for their code - being a traditional table or a harvested data table.) But again, for the vast majority, they don't even look at these files, but we're wasting their time by including extraneous characters in these files.

Please do not "fix" this. It's a feature, not a bug.

funkydude commented 1 month ago

It does appear that this is still the case on live, so it's probably intended.

Meorawr commented 1 month ago

The removal of extraneous characters (indenting, comment indexing for arrays, etc) in the SavedVariable files significantly decreased the loading times for the primary use case.

Having done a test with a saved variable file consisting of over 1.3 million lines both without indentation and indentation set to 8 spaces and the garbage collector disabled to minimize variance, I'm only seeing a load time difference of between 0.1 to 0.15 seconds. The unindented version takes about 0.5s and the indented one 0.6s - both with deviation of roughly 0.05s if I time them in a loop.

It's a gain but it's incredibly minor given that most saved variable files aren't going to touch 1.3 million lines to begin with. Could you elaborate on the measurements you're seeing where this is providing a substantial difference?

DFortun81 commented 1 month ago

This change also came at the same time that they removed array comment indexing where they would write the index for each array element next to its data, so my results are likely skewed by this data being present in the files and then being absent.

EDIT: That said, any amount of savings we can scrape together to decrease the load time is a welcome change. 0.1s might not seem like a whole lot, but multiply that by the number of addons (particularly large database addons like ATT) and you get a solid reduction overall. For reloading (/reloadui), writing less to the hard drive means that process takes less time as well.