View Single Post
08/21/15, 10:42 AM   #29
Sasky
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 231
Originally Posted by merlight View Post
Great.

I was curious whether shrinking SavedVars files could speed-up their loading. Currently they're indented with spaces. Typical saved vars from add-ons I have are literally full of spaces. I tried replacing them with tabs (4 spaces -> 1 tab) in files larger than 10k. The results were 23% to 57% smaller (not counting the above-mentioned combat log add-on, which was only 10% because it stores long strings).
Depends on disk access speed, but it'd probably be minor. If disk access is really slow, compressing the SavedVars file before writing could actually speed it up.

Originally Posted by sirinsidiator View Post
We could avoid this problem altogether with a sqlite database.
No more loading everything into memory on ui load and (almost) no data is lost on crashes.
Addons like Harvest Map or Master Merchant would really profit from a database.
Sure, any of the data-oriented addons would benefit from having a partially loaded database. Most addons probably would not benefit really from that, though, and there's also the consideration of structure. Lua tables are extremely unstructured which means the SavedVars are "just use it". A relational database would need to define table structure. Just imagine how many more "SavedVars" threads there'd be with SQL added to it.

Not sure how hard it'd be to integrate Lua drivers with it, but looks like this would be the way to go for ZOS to add SQL support:
http://keplerproject.github.io/luasql/doc/us/
Potentially it could be run under a separate memory pool as well, which would take away a lot of the need to increase the Lua memory limit.