honzaap / Systemizer

A system design tool that allows you to simulate data flow of distributed systems.
https://honzaap.github.io/Systemizer/
GNU General Public License v3.0
1.38k stars 90 forks source link

Way to optimize save file size #28

Closed honzaap closed 3 years ago

honzaap commented 3 years ago

This is just for needs of making an embed functionality (like Issue #15). If I wanted to make an IFrame, it would need to pass the save file to the url, however the current size is too big for that (about 9-10kB for 30 components). I did some optimizations of the variable names(make them 1-3 characters long) and few tweaks, but only managed to get it to little more than half of its original size (still about 5kB for just 30 components).

I also tried:

After all of this, there is still a problem with the need of base64 encoding for the url parameter... which make the size about 30% bigger. In the end, the "url parameter ready" save file would have about 6.5kB for board with 30 components. Which is terrible...

If you have any suggestions or tips, please share them in the comments. My goal is to get the size as low as possible, let's say about 3-4kB for 30 components.

honzaap commented 3 years ago

Managed to get the size to about half... Still think it could be reduced even more so I will keep it open for now