I’ve started working on improving the file size of Emglken’s wasm files.
- Moving the unicode buffer functions to JS saved 330kb from Glulxe/Git.
- Disabling the “std” feature for the Jiff library cut 48kb from Glulxe/Git.
- Building Rust with
codegen-units=1saved 30-45kb per VM.
I’ve also tested some changes which I’m not sure about:
- A manual Serde deserialiser for the Metrics struct. It would save about 14kb (down from 20kb), but it’s not completely comparable as it doesn’t have as thorough error checks; were I to decide to use it I’d probably want to add a few more. I’m not sure about it as it’s a comparatively small change, and it’s one of the few structs that a manual deserialiser might actually make sense for (as it’s very repetitive).
- Stopping normalising dates cuts 48kb from Glulxe/Git.
I’m not sure what the next optimisation to attempt would be. There’s a very long tail here; I think switching to RemGlk-rs has added a lot of code in large part because of the Mutexes I have to use all over the place. Each one isn’t a lot, but they all add up.