Thread Tools Display Modes
03/23/19, 01:48 PM   #1
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
[open] Change saved vars file

The indention in the saved vars is done by 4 spaces per level. Why not use tabs? I took a 1.5MB save file, converted every 4 spaces to 1 tab and the file size was literally halved.

I don't know how much those extra characters affect load/save times, but even if they don't: I know I wouldn't mind the extra HDD space.
  Reply With Quote
03/23/19, 05:00 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,068
Does ESO support shrinked lua files (removing all spaces where not needed?), like minimzed javascript files e.g.?
Maybe one can even minimize the files of the SVs then (if you like to cuz it breaks readability).
  Reply With Quote
03/28/19, 03:38 PM   #3
Drummerx04
AddOn Author - Click to view addons
Join Date: Sep 2017
Posts: 54
Originally Posted by Baertram View Post
Does ESO support shrinked lua files (removing all spaces where not needed?), like minimzed javascript files e.g.?
Maybe one can even minimize the files of the SVs then (if you like to cuz it breaks readability).
Yes, the Lua interpreter in ESO does support a "shrunken" format. The language grammar itself does not set any requirements on the presence of whitespace beyond using a single whitespace character to separate two s-expressions.

Most programming languages that I've seen have no specific requirements for whitespace with python and makefiles being the most notable exceptions.

On an interesting side note: Code65536 and I encountered a bug (that we haven't seen again) where the saved variable files actually got written to disk without the formatting whitespace.
  Reply With Quote
03/28/19, 04:36 PM   #4
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,589
Originally Posted by Drummerx04 View Post
On an interesting side note: Code65536 and I encountered a bug (that we haven't seen again) where the saved variable files actually got written to disk without the formatting whitespace.
It's not a bug, it's a feature of the new auto-save. It skips writing whitespace characters in order to save time.
  Reply With Quote
03/28/19, 06:54 PM   #5
Drummerx04
AddOn Author - Click to view addons
Join Date: Sep 2017
Posts: 54
Originally Posted by sirinsidiator View Post
It's not a bug, it's a feature of the new auto-save. It skips writing whitespace characters in order to save time.
Oh nice. I knew they had added auto-save, but I wasn't sure whether that was the cause. Thanks!
  Reply With Quote
04/11/24, 08:16 AM   #6
SimonIllyan
 
SimonIllyan's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2018
Posts: 2
Originally Posted by sirinsidiator View Post
It's not a bug, it's a feature of the new auto-save. It skips writing whitespace characters in order to save time.
Sorry to jump into this old thread, but… can this behaviour be forced? I mean, it would be nice to have those excessive whitespaces reduced at every write, not just auto-save. They are needed for debugging, otherwise… not so much. And the reduction of file size can be serious.
  Reply With Quote
03/28/19, 04:58 PM   #7
Rhyono
AddOn Author - Click to view addons
Join Date: Sep 2016
Posts: 659
Well if ZOS found writing whitespace to be that much slower, then cutting the whitespace down by 75% is important.
  Reply With Quote
04/11/24, 12:18 PM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,068
No, unfortunately it cannot.
  Reply With Quote
04/15/24, 06:03 PM   #9
ZOS_DanBatson
ZOS Staff!
 
ZOS_DanBatson's Avatar
Yes this person is from ZeniMax!
Join Date: Jul 2015
Posts: 184
Might as well keep this ask open though. It's on my agenda to offer some more compression options for Saved Vars, this specific ask included.
  Reply With Quote
04/15/24, 07:51 PM   #10
Anthonysc
AddOn Author - Click to view addons
Join Date: Jan 2022
Posts: 10
Originally Posted by ZOS_DanBatson View Post
Might as well keep this ask open though. It's on my agenda to offer some more compression options for Saved Vars, this specific ask included.
Not going to lie, that would be pretty awesome. My PvpAlerts savedvariables is over 15MB now, and that's after I implemented a function to purge it of some old data that wasn't needed anymore. I haven't enabled that function in the release version yet so I'm betting other people's are sitting upwards of 20, 25MB if they've never started from scratch. (Replacing spaces with tabs cut the file from 15MB to 8.7MB.) KillCounter savedvariables is similarly hitting over 10MB. These addons are definitely not typical, they log a lot of information about various PVP encounters, but something to cut them down beyond hacking in new code functions to the addons themselves to do cleanups would be very welcome.

Last edited by Anthonysc : 04/15/24 at 07:55 PM.
  Reply With Quote
04/16/24, 05:12 AM   #11
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,589
Originally Posted by ZOS_DanBatson View Post
Might as well keep this ask open though. It's on my agenda to offer some more compression options for Saved Vars, this specific ask included.
Oh nice. I know it's not compression related, but still somewhat on topic, so when you are looking into the saved vars, could we please also get an option to have it save string keys in alphabetic order instead of randomly sorted? That would make debugging saved vars so much easier, as it would allow to easily compare two copies of a file.
  Reply With Quote
04/16/24, 07:04 AM   #12
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 5,068
Originally Posted by sirinsidiator View Post
Oh nice. I know it's not compression related, but still somewhat on topic, so when you are looking into the saved vars, could we please also get an option to have it save string keys in alphabetic order instead of randomly sorted? That would make debugging saved vars so much easier, as it would allow to easily compare two copies of a file.
+1
!Yes please!
  Reply With Quote
04/19/24, 03:58 PM   #13
Toirealach
AddOn Author - Click to view addons
Join Date: Sep 2020
Posts: 33
Originally Posted by Baertram View Post
+1
!Yes please!
+99999999 please please please!
  Reply With Quote

ESOUI » Developer Discussions » Wish List » [open] Change saved vars file

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off