Skip to content

Rolling up some more PRs #13397

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

Closed
wants to merge 16 commits into from
Closed

Conversation

alexcrichton
Copy link
Member

No description provided.

radford and others added 16 commits April 8, 2014 00:03
This separate crate cache is one factor which is causing libstd to be loaded
twice during normal compilation. The crates loaded for syntax extensions have a
separate cache than the crates loaded for linking, so all crates are loaded once
per #[phase] they're tagged with.

This removes the cache and instead uses the CStore structure itself as the cache
for loaded crates. This should allow crates loaded during the syntax phase to be
shared with the crates loaded during the link phase.
When linking, all crates in the local CStore are used to link the final product.
With #[phase(syntax)], crates want to be omitted from this linkage phase, and
this was achieved by dumping the entire CStore after loading crates. This causes
crates like the standard library to get loaded twice. This loading process is a
fairly expensive operation when dealing with decompressing metadata.

This commit alters the loading process to never register syntax crates in
CStore. Instead, only phase(link) crates ever make their way into the map of
crates. The CrateLoader trait was altered to return everything in one method
instead of having separate methods for finding information.
This is an optimization which is quite impactful for compiling small crates.
Reading libstd's metadata takes about 50ms, and a hello world before this change
took about 100ms (this change halves that time).

Recent changes made it such that this optimization wasn't performed, but I think
it's a better idea do to this for now. See rust-lang#10786 for tracking this issue.
Few places where previous version of tidy script cannot find XXX:
* inside one-line comment preceding by a few spaces;
* inside multiline comments (now it finds it if multiline comment starts
on the same line with XXX).

Change occurences of XXX found by new tidy script.
Apparently windows doesn't like reading from stdin with a large buffer size, and
it also apparently is ok with a smaller buffer size. This changes the reader
returned by stdin() to return an 8k buffered reader for stdin rather than a 64k
buffered reader.

Apparently libuv has run into this before, taking a peek at their code, with a
specific comment in their console code saying that "ReadConsole can't handle big
buffers", which I presume is related to invoking ReadFile as if it were a file
descriptor.

Closes rust-lang#13304
Closes rust-lang#11881.

This code has been copied from the original issue and updated for
modern Rust APIs.
Closes rust-lang#13394 (sync: remove unsafe and add Send+Share to Deref (enabled by autoderef vtables))
Closes rust-lang#13389 (Made libflate functions return Options instead of outright failing)
Closes rust-lang#13388 (doc: Document flavorful variations of paths)
Closes rust-lang#13387 (Register new snapshots)
Closes rust-lang#13386 (std: Add more docs for ptr mod)
Closes rust-lang#13384 (Tweak crate loading to load less metadata)
Closes rust-lang#13382 (fix ~ZeroSizeType rvalues)
Closes rust-lang#13378 (Update tidy script, replace XXX with FIXME)
Closes rust-lang#13377 (std: User a smaller stdin buffer on windows)
Closes rust-lang#13369 (Fix spelling errors in comments.)
Closes rust-lang#13314 (Made 'make install' include libs for additional targets)
Closes rust-lang#13278 (std: make vec!() macro handle a trailing comma)
Closes rust-lang#13276 (Add test for rust-lang#11881)
@bors bors closed this Apr 8, 2014
@alexcrichton alexcrichton deleted the rollup branch April 8, 2014 16:56
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.