-
Notifications
You must be signed in to change notification settings - Fork 150
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
Gather slow workflows from stakeholders #232
Comments
|
Most of our projects are quite painful to develop. The most painful ones are sentry-cli and sentry-semaphore (both are applications). What's slow is mostly Semaphore is similar but actually takes significantly longer, something I have seen happen on other actix-web projects as well. I would expect <5 seconds for small incremental changes on build and almost instant on I'm happy to assist you in any way you want with this as iteration times are the number one issue we have right now. |
Only real issue I have seen with this may not be directly rustc/cargo core’s problem, but thought I would log here in case. When targeting emscripten, using the recommended setup for wasm compilation linked to from the yew readme, I was seeing very long initial build times on the example yew projects, much larger than I would expect for a project of that size. Link to example projects at the version we were testing with: https://github.com/DenisKolodin/yew/tree/c48a15488b404ee5cc7680037cff1f3642690255/examples (OSX latest version, rust nightly from ~2 weeks ago - will confirm when on work machine tomorrow, using command |
I think testing actix-web compile performance might be a fun one. Probably a hello-world or something would do.
I feel web stuff is a common starting point for folks, so optimizing that might help people have a nicer initial experience! 😁 |
Well there's my old rust-lang/rust#42596 that I think is still valid; I've not let it go the whole way, but on 1.26 it still got to 5G in a few seconds and I'd originally seen it hit 75G. Optimising my compile-time mandelbrot is probably not worth it given how weird it is, but it did take 20G of RAM if anyone fancies a challenge ( http://www.treblig.org/daveG/rust-mand.html ) |
On my laptop syntect with Edit: The first time I ran these tests a dumb bug in a different program was pegging 2 of my 4 cores. I've edited in the new results, but the old results may be representative of a 2 core laptop. I'm much more satisfied with the new results. Although I'm still disappointed at the duplicate error messages and the 2x overhead of building twice for no apparent reason. I don't confess to understand the reason but it seems like fixing it might be easier than finding other 2x perf wins.
These incremental results on a recent compiler are much better than they used to be before incremental compilation and all the recent fixes, so kudos for that. |
I just did this today. A hello world example of Actix-web takes 172 seconds on a Core i7 MacBook Pro with 16G of memory. Rust version: 1.26.0 |
I hope this is on point with your request - cargo build makes my entire laptop slow (ubuntu). I find adding "ionice -c3 cargo build" leaves my laptop responsive with little to no impact on the build time. The other benefit is that I have lower blood pressure during the sometimes long build. I would love a feature added to cargo to put all builds at this priority vs having to wrap this command. |
|
Link to CodePick any popular crate with tons of popular dependencies, such as Details of which workflow is smallInitial builds and builds after What performance are you seeing?
What performance would you expect?
How do you propose we might solve that problem?A first step might be to cache debug and test build artifacts globally in e.g. A second step would be to have a build server for the most common targets on |
Project is http://github.com/sstangl/openpowerlifting. It's primarily a data project. The Rust code is under the The data is generated as CSV files, which we load into the server at startup using the On my laptop (i7, 8GB RAM), If I touch Really, I want a way to specify that the We test our project using TravisCI, which generously provides free CI for F/OSS projects. On their infrastructure (https://travis-ci.org/sstangl/openpowerlifting), a single build takes about 13 minutes, about 10 minutes of which are building the server. That's a long while for feedback on a small project! |
I completely forgot the big daddy of perf issues I have...
|
From the other end of the spectrum: I built a tiny livecoding system that compiles to a dylib whever anything changes, and the 900-line code base takes ~3 seconds to compile (calling The code is here, quite amateurish, and probably won't work on non-Macs because of the live-reloading tricks. |
With C / gcc:
With a fast language implementation:
|
for those non-dog owners out there (like me), this ends up being about 160 seconds for the entire dependency tree |
An interesting question! Looking at https://github.com/Wilfred/remacs, I see that it takes ~1m20s to compile ~450k lines of C (and a tiny amount of Rust and a dozen Rust dependencies; tested by running Then it takes about 5 minutes to compile 1.5M lines of Emacs Lisp code. (Tested by running Looks like the Rust compiler is a lot slower when measured in lines/second (but I didn't count the lines from the Rust dependencies, so the test needs refinement). And then there's the test suite, but I'm not going to measure that. Of course, In practice you're almost always doing a partial build; it usually takes less than 10 seconds to get the first error message if you're working on the Rust code, so it's not too bad. We wouldn't complain if it was faster, but it's not actually painful. |
I have two short wasm scripts and for some reason it takes 17 minutes to build them with travis. I use caching so I wonder what is wrong. |
Link to code: https://github.com/saethlin/slack-rs-api Which workflow is slow: All of the above, but I'd really really please like What performance I'm seeing: 11 seconds to run What performance I expect: Closer to 1 second for |
I am not sure it is related to
The generated parser is huge... |
So in summary, the incremental compilation caches for tiny crates are just really really big. I'd expect most of the people checking this out to be working on the Rust compiler. Is there a file in the compiler somewhere, where a one line change followed by a |
I should also mention that the stable, non-incremental re-building of the project is also extremely slow, but this seems seems to be reduced greatly when using nightly with incremental building enabled (~5secs as opposed to a 30secs-1min), so it seems like a fix for this is already in the pipeline. |
Generally speaking timely and differential dataflow are slow to build. This seems to be mostly "in LLVM", but it is still a bit surprising as while there are a great many generics lying around (and likely massive monomorphisation), their use feels like it should be mostly plug and play. E.g. "we start with a data type of Here are some repo links; https://github.com/frankmcsherry/timely-dataflow A concrete very slow to build repo is https://github.com/frankmcsherry/differential-dataflow/tree/master/tpchlike which usually takes about 20mins or so in release mode, again despite appearing relatively uncomplex (though certainly under the covers being wildly complicated, for reasons that aren't clear). I wouldn't be surprised to learn that these programs take a while to compile because they are written in a complicated way, and perhaps one thing that would be helpful is advice on "performance debugging compilation": not making the compiler magically faster (obvs great), but explaining what makes the process slow and what idioms could avoid that (e.g. use boxing wherever you can afford it; generics seem smart, but are really expensive). |
@gnzlbg, I just tried https://github.com/gnzlbg/slice_deque and I can reproduce your numbers. My incremental cache after |
@michaelwoerister thanks for looking into this, I will open an issue and CC you there |
https://travis-ci.org/alex/linux-kernel-module-rust/builds/380900065#L483 Command that is slow is |
I pinned down a version of sentry-cli that I can test across compiler versions, and here's what I'm seeing locally. (The workflows here are for just the "root" crate, after all dependencies have been processed already; clear_cache refers to the incremental compilation cache; times are in seconds)
|
On a laptop with i7-3520m, rust stable 1.26 (after
(one run)
|
Link to code: https://github.com/mit-pdos/distributary (@ 1b518a5e83658f13dc5624e3780ca317c8fb7360) Both build from scratch and rebuild after changes is generally somewhat slow (though it has been getting a lot better!). The issues are particularly noteworthy when you have few cores available. On my current 12HT AMD 2600X (so quite beefy!), things aren't too bad:
Note that this is with the environment variables from rust-rocksdb/rust-rocksdb#166 set so that rocksdb isn't also compiled. I'd like to echo @ordian's comments above that things get fairly frustrating when you switch between branches and recompile, or even if you make, say, changes to unit tests, and that causes the whole crate to be recompiled. Ideally I'd like to see turnaround of sub-10s when I make minor edits (add/rm |
I've got a project which has a bunch of generic future adapters which have lots and lots of bounds in order to keep things as decoupled as possible. There is also a few top level futures which unify all the adapaters in the crate, and checking/building that code slows things down 3-4x for I had to specifically put that code behind a feature flag so I can disable it to keep my development sanity and let the CI build the whole thing. (My understanding is that this is due to rustc rechecking generic bounds over and over again without caching results, so looking forward to chalk improving this!) Link to project: https://github.com/ipetkov/conch-runtime # All examples with warmed up deps
$ touch src/lib.rs
$ cargo check --no-default-features --features 'conch-parser'
Checking conch-runtime v0.1.4 (file:///Users/ivan/Desktop/shell_stuff/conch-runtime)
Finished dev [unoptimized + debuginfo] target(s) in 2.45s
$ touch src/lib.rs
$ cargo check
Checking conch-runtime v0.1.4 (file:///Users/ivan/Desktop/shell_stuff/conch-runtime)
Finished dev [unoptimized + debuginfo] target(s) in 40.92s
$ touch src/lib.rs
$ cargo build --no-default-features --features 'conch-parser'
Compiling conch-runtime v0.1.4 (file:///Users/ivan/Desktop/shell_stuff/conch-runtime)
Finished dev [unoptimized + debuginfo] target(s) in 12.06s
$ touch src/lib.rs
$ cargo build
Compiling conch-runtime v0.1.4 (file:///Users/ivan/Desktop/shell_stuff/conch-runtime)
Finished dev [unoptimized + debuginfo] target(s) in 47.29s EDIT: Forgot to mention: I'd expect more of a linearish build time increase with more and more complex generic types rather than a the current blow up Another semi-related topic: I really with that cargo/rustc could tell if I've changed Worth noting I started doing this way before incremental compilation became stable, so I haven't checked if this would still be a problem because I have way too many tests to port back to the idiomatic unit testing way! |
|
Installing any binary with
Consecutive builds are no faster. And that tool is <1kLoC with 11 dependencies. On a fast machine like this I would expect the first build to be way below 1 minute and rebuilds without further changes instantaneous. The same applies to pretty much all crates which can be installed using |
A case of crazy long compile times. For a real, one-off program I wrote for work, I used Python to generate HashMap insert lines for about 4000 entries. Here is a simplified example: debug build: 2.8 seconds If you hold on to just the first 500 inserts or so... things are bit more manageable for debugging: debug build: 0.4 sec If you peek at
|
[*] By reasonable I mean that adding a new match statement with 256 arms to the library barely changes the compile-time of the library. |
Have you ever complained that rustc is slow? We want to know more!
Please leave comments here with the following details:
cargo check
,cargo build
,cargo test
, rebuild after changes, etc)These details will help us discover new problem areas, and potentially feed the benchmark suite.
The text was updated successfully, but these errors were encountered: