ron icon indicating copy to clipboard operation
ron copied to clipboard

Build time regression from the Compound type

Open kvark opened this issue 5 years ago • 5 comments

... 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

kvark avatar May 25 '20 21:05 kvark

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)

Plecra avatar May 26 '20 12:05 Plecra

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.

nnethercote avatar May 26 '20 22:05 nnethercote

This is the likely cause of an installer size increase for Firefox when Firefox updated to 0.6.2.

nnethercote avatar Sep 17 '20 23:09 nnethercote

@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.

kvark avatar Sep 17 '20 23:09 kvark

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.

juntyr avatar Jan 02 '22 06:01 juntyr