ron
ron copied to clipboard
Build time regression from the Compound type
... introduced in #206 According to https://github.com/ron-rs/ron/pull/206#issuecomment-633362867, results in 13% increase in IR size. We want multiple parts of Gecko to ship (at least on Nightly) with RON built-in and enabled, so code size is important: we want that path to be as light as possible. cc @nnethercote @Plecra
I hope we can start with assessing the actual impact - the number of instantiations haven't changed, and LLVM just seems to be reporting 3x the IR size in each function. This doesn't directly reflect the final code size or the compile time (which I'm assuming is what we really care about)
LLVM IR size has proven to be a good proxy for compile times, particularly for debug builds. See https://github.com/rust-lang/rust/pull/72013 for one example. But it would certainly be worthwhile for you to check that this observation holds for this case as well.
This is the likely cause of an installer size increase for Firefox when Firefox updated to 0.6.2.
@nnethercote looks like bincode-1.3 was able to address it on their side, but I'm not able to find the exact change/PR on a cursory look.
During deserialization we read in and buffer all bytes. Could we do something similar and revert to appending to a String in the Deserializer, which is only flushed to a writer at the end? This would reduce most of the duplication at the cost of not supporting extremely large RON documents.