-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop compressing metadata #9365
Comments
cc #8752 |
Closing, this is done. Rlibs don't have compressed metadata, but dylibs still do (due to linker restrictions) We prefer reading rlibs, so we're getting all the benefits anyway. |
What was the perf gain from not compressing metadata? I am trying to create a dynamically linked snapshot and I would rather not increase its size significantly. Initial increase was from I understand compression can add to the compilation time, but I think it's faster without field names and I only really need it turned on for snapshots. @alexcrichton Any ideas? Perhaps I should open another issue for shrinking binary sizes in general, I believe #14527 might help with that - also, bundling all the crates behind the std facade within a dynamically linked std and something similar for |
Turns out I completely forgot the snapshot is compressed, and with |
I'm a bit hazy on the details at this point, so I decided to re-run the numbers: extern crate alloc;
extern crate arena;
extern crate collections;
extern crate core;
extern crate debug;
extern crate flate;
extern crate getopts;
extern crate glob;
extern crate graphviz;
extern crate green;
extern crate libc;
extern crate log;
extern crate native;
extern crate num;
extern crate rand;
extern crate rbml;
extern crate regex;
extern crate rlibc;
extern crate rustrt;
extern crate semver;
extern crate serialize;
extern crate sync;
extern crate term;
extern crate test;
extern crate time;
extern crate unicode;
extern crate url;
#[cfg(so)] extern crate rustc;
#[cfg(so)] extern crate rustdoc;
#[cfg(so)] extern crate uuid;
fn main() {} Reading rlib metadata
Reading dylib metadata
Note that reading compressed metadata adds an extra 22ms to all rust compilations, and as we continue to proliferate libraries through cargo I suspect that this will only get worse. The benefit of an uncompressed metadata file is that it can be I had no idea we had some sort of "debug" flag turned on for rbml, we should definitely turn that off if it's just bloating metadata! Also, as you seem to have figured out, metadata is super compressable, so I would only worry about the gzip sizes. I wouldn't worry too much about the distribution size of the snapshot as it's not like it's downloaded on every rust compile! |
[Arithmetic] Consider literals Fixes rust-lang/rust-clippy#9307 and makes the `arithmetic` lint behave like `integer_arithmetic`. It is worth noting that literal integers of a binary operation (`1 + 1`, `i32::MAX + 1`), **regardless if they are in a constant environment**, won't trigger the lint. Assign operations also have similar reasoning. changelog: Consider literals in the arithmetic lint
Decompressing metadata takes time. I have a branch that turned off compression but it was causing dynamic linker crashes.
The text was updated successfully, but these errors were encountered: