Uh oh!
There was an error while loading. Please reload this page.
Use a more efficient encoding for opaque data in RBML. - #30565
Conversation
rust-highfive
commented
Dec 26, 2015
(rust_highfive has picked a reviewer for you, use r? to override) |
0245e4e to
d2ce797Comparemichaelwoerister
commented
Dec 26, 2015
Which it by the way shouldn't do for 1-byte and floating point numbers... I'll change that in a separate PR some time. |
michaelwoerister
commented
Dec 26, 2015
cc @alexcrichton@brson who might be interested in things concerning the binary size of our libraries. |
eddyb
commented
Dec 26, 2015
@arielb1 Worked on metadata, and I remember something about switching to a fixed-sized integer model (for decoding speed? not sure). |
michaelwoerister
commented
Dec 26, 2015
@eddyb I did some non-rigorous performance comparisons, compiling libsyntax a few times with and without the changes in this PR. I found no observable difference between the two. That being said, once the support for an alternate encoding is in place, it would be easy to change how numbers and other primitive types are emitted and we could take a look if fixed size integer would make things faster (although I doubt that it makes much of a difference for overall compilation time). |
arielb1
commented
Dec 27, 2015
I don't see any problems with the idea itself. |
arielb1
commented
Dec 27, 2015
We probably don't need 2 separate vuint encoding schemes (rbml's |
arielb1
commented
Dec 27, 2015
Incidentally, the primary worry is not the cost of writing metadata but that of reading it - which is already 2% of compilation time with the old code according to some old measurements I have made. For that, |
bors
commented
Dec 28, 2015
☔ The latest upstream changes (presumably #30582) made this pull request unmergeable. Please resolve the merge conflicts. |
michaelwoerister
commented
Dec 28, 2015
In principle I agree. RBML vuint can only handle unsigned values though and I don't know if we want to break away from EBML's prescribed encodings for tags and sizes. |
michaelwoerister
commented
Dec 28, 2015
Here are some timings from compiling librustc_driver: I don't see much of a difference between any of those. |
d2ce797 to
fa2a741Comparemichaelwoerister
commented
Dec 28, 2015
... rebased |
brson
commented
Dec 28, 2015
Looks good. |
brson
commented
Dec 29, 2015
@bors r+ |
bors
commented
Dec 29, 2015
📌 Commit fa2a741 has been approved by |
bors
commented
Dec 30, 2015
bors
commented
Dec 30, 2015
bors
commented
Dec 30, 2015
👀 Test was successful, but fast-forwarding failed: 422 Reference already exists |
…brson This PR changes the `emit_opaque` and `read_opaque` methods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits. The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed. | RLIBs | NEW | OLD | |--------------|--------|-----------| |libstd | 8.8 MB | 10.5 MB | |libcore |15.6 MB | 19.7 MB | |libcollections| 3.7 MB | 4.8 MB | |librustc |34.0 MB | 37.8 MB | |libsyntax |28.3 MB | 32.1 MB | | SOs | NEW | OLD | |---------------|-----------|--------| | libstd | 4.8 MB | 5.1 MB | | librustc | 8.6 MB | 9.2 MB | | libsyntax | 7.8 MB | 8.4 MB | At least this should make up for the size increase caused recently by also storing MIR in crate metadata. Can this be a breaking change for anyone? cc @rust-lang/compiler
This PR changes the
emit_opaqueandread_opaquemethods in the RBML library to use a space-efficient binary encoder that does not emit any tags and uses the LEB128 variable-length integer format for all numbers it emits.The space savings are nice, albeit a bit underwhelming, especially for dynamic libraries where metadata is already compressed.
At least this should make up for the size increase caused recently by also storing MIR in crate metadata.
Can this be a breaking change for anyone?
cc @rust-lang/compiler