Hi there.
I’m a developer that maintains the AllTheThings addon for all versions of WoW and this is something that’s been itching at me for the longest time.
SavedVariables for WoW are encoded to be human readable. They have comments for table positions and indexes and tabulation and new lines literally everywhere. This makes for a data document containing several hundred thousand indexes in a table to be massive.
Not only does this make the file large, but since Lua is a text-based language, it also makes for loading the SavedVariables take a lot longer than they need to. Expand that by 100 addons with a lot of saved variables and you’ve got yourself a mountain of load time attributed to data that no normal user needs to see.
I propose an option in the TOC document for an addon to enable human readable SavedVariables, but to have the default behaviour be to compress the file as much necessary. (bare in mind that there is a hard limit on the number of characters you can have on a single line, make sure not to exceed this limit, you can add a random newline character somewhere and it’ll prevent it from crashing the interpreter)
With an option in the TOC doc, it makes it so that addon developers can still enable this option to makes their documents readable, but also provide compression so that we can reclaim a lot of wasted time and energy that is currently being taken by these huge files. I’m sure if this option is provided in the TOC that addon distributors such as CurseForge or WAGO.io can export addons with this option disabled so that end users always get production quality compression when targeting Release builds.
I personally have a tool that compresses all of my SavedVariables when I exit the game and it simply removes all newlines, all tabs, all spaces, and all comments and my load time was cut down by about 10-15 seconds. Imagine the gains for people with an excessive number of addons!
Thanks!
EDIT: To give you a figure, ATT’s SavedVariable file as is is about 4.5 MB. With just removing the whitespace/comments, it goes down to about 2.1 MB. While that doesn’t sound like a whole lot, bare in mind that’s just extraneous characters. The raw data itself isn’t compressed at all.