Open byorgey opened 4 months ago
I suspect there is a lot of bloat from multiple closures containing Env
s that contain duplicate bindings. In memory, there is a lot of sharing going on, but we lose the sharing when we serialize.
Another bit of low-hanging fruit is to make custom instances for Type
and Term/Syntax
where ToJSON
pretty-prints to a string and FromJSON
runs the parser.
@byorgey, how about splitting low-hanging fruits from this one? 🙂
@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.
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.