I want to think about how to optimise large state objects
At the end of each step we do a bunch of processing on objects, including:
- cleaning up the returned state
- serializing the state object out of the worker thread
- serializing the state object out of the child process
- serializing the state object through the websocket
- trying to work out the size of the object (once or many times)
- I think there's some stuff about removing circular references
I'd like to explore things like:
- using shared memory buffers to reduce serialization
- using heuristics to guess that state object is large (Ie, an array of 10k items, or an object more than 100 properties deep), and then optimising around that (like bailing out of serialization and circularity checking earlier)
I want to think about how to optimise large state objects
At the end of each step we do a bunch of processing on objects, including:
I'd like to explore things like: