-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize generated JSON size #1907
Comments
I suspect there is a lot of bloat from multiple closures containing |
Towards #1907. For the most part, eschew the default To/FromJSON deriving in favor of `sumEncoding = ObjectWithSingleField`, which encodes `Constructor val` as something like `Constructor: val` instead of `{tag: Constructor, contents: val}`. Also omit empty `Comments` records. In the context of #1907, this reduced the size of the generated JSON by about half.
Another bit of low-hanging fruit is to make custom instances for |
@byorgey, how about splitting low-hanging fruits from this one? 🙂 |
Well, to be honest, I'm not sure what they are. I already addressed the one example I mentioned. |
@byorgey we could split off some improvements (numbers are for Blank scenario base):
|
@xsebek Good finds! Those would all indeed make for nice improvements. Some of them can probably be addressed with better options given to the generic |
As an experiment towards #50 (see also #347), I started up a creative scenario, loaded some code from a
.sw
file, ran a base program, and then serialized a snapshot of the base's CESK machine to a file. Unfortunately it was almost 3MB in size! However, most of it was unnecessary junk such as empty comments records. If we want saving games to be practical we will need to work a lot harder to minimize the size of generated JSON.As one simple example, if a
Comments
record is empty we should be able to omit it entirely from the output. I'm sure there is lots more similar low-hanging fruit.The text was updated successfully, but these errors were encountered: