This allows cross-crate inlining which is *very* good because this is called a lot throughout libstd (even when libstd is inlined across crates). In one of my projects, I have a test case with the following performance characteristics commit | optimization level | runtime (seconds) ----|------|---- before | O2 | 22s before | O3 | 107s after | O2 | 13s after | O3 | 12s I'm a bit disturbed by the 107s runtime from O3 before this commit. The performance characteristics of this test involve doing an absurd amount of small operations. A huge portion of this is creating hashmaps which involves allocating vectors. The worst portions of the profile are:  Which as you can see looks like some *serious* problems with inlining. I would expect the hash map methods to be high up in the profile, but the top 9 callers of `cast::transmute_copy` were `Repr::repr`'s various monomorphized instances. I wish there we a better way to detect things like this in the future, and it's unfortunate that this is required for performance in the first place. I suppose I'm not entirely sure why this is needed because all of the methods should have been generated in-crate (monomorphized versions of library functions), so they should have gotten inlined? It also could just be that by modifying LLVM's idea of the inline cost of this function it was able to inline it in many more locations. |
||
|---|---|---|
| .. | ||
| compiletest | ||
| driver | ||
| etc | ||
| gyp@f407f09c94 | ||
| libextra | ||
| librust | ||
| librustc | ||
| librustdoc | ||
| librusti | ||
| librustpkg | ||
| libstd | ||
| libsyntax | ||
| libuv@d88cf5652a | ||
| llvm@08a3bd96ee | ||
| rt | ||
| rustllvm | ||
| test | ||
| README.txt | ||
| snapshots.txt | ||
This is a preliminary version of the Rust compiler, libraries and tools Source layout: librustc/ The self-hosted compiler libstd/ The standard library (imported and linked by default) libextra/ The "extras" library (slightly more peripheral code) libsyntax/ The Rust parser and pretty-printer rt/ The runtime system rt/rust_*.cpp - The majority of the runtime services rt/isaac - The PRNG used for pseudo-random choices in the runtime rt/bigint - The bigint library used for the 'big' type rt/uthash - Small hashtable-and-list library for C, used in runtime rt/sync - Concurrency utils rt/util - Small utility classes for the runtime. rt/vg - Valgrind headers rt/msvc - MSVC support rt/linenoise - a readline-like line editing library test/ Testsuite test/compile-fail - Tests that should fail to compile test/run-fail - Tests that should compile, run and fail test/run-pass - Tests that should compile, run and succeed test/bench - Benchmarks and miscellanea test/pretty - Pretty-printer tests test/auxiliary - Dependencies of tests compiletest/ The test runner librustpkg/ The package manager and build system librusti/ The JIT REPL librustdoc/ The Rust API documentation tool llvm/ The LLVM submodule libuv/ The libuv submodule rustllvm/ LLVM support code libfuzzer/ A collection of fuzz testers etc/ Scripts, editor support, misc