6 ms·
What is “slow”? I mostly do JS and .NET, and I just started working through the rust hello world. I was shocked that I had an exe in around 0.2s. I haven’t work
by lukevp 6y ago
What is “slow”? I mostly do JS and .NET, and I just started working through the rust hello world. I was shocked that I had an exe in around 0.2s. I haven’t worked on a large project so maybe this doesn’t scale, but of the 3 (at least for hello world which is fairly trivial) rust felt super fast. I saw mention of Roslyn so perhaps the issue is more around incremental compiles for IDE feedback? I didn’t see any issues with the VS Code language server (and I love the auto format on save, I set this up with prettier and I don’t want to go back to a place without auto formatters for everything. It’s great DX.)
- fsociety 6y agoI think it’s more of a question for compiling programs with LOC in the millions. The compile times for projects like LLVM, Chromium, and Tensorflow for example are disgusting.
- dkarlovi 6y agoWhat's the rough scale of "disgusting" here?
- sangfroid_bio 6y agoCompilation speed comparable to template heavy C++, a large difference compared to Go for similarly sized projects
- chubot 6y agoOne observation on LLVM Building LLVM from source, I was told in another forum, took 26 minutes across 16 cores on a top-end machine (ie. several hours on one core). I guess I don't need to build LLVM(?) https://old.reddit.com/r/ProgrammingLanguages/comments/hhxisw/how_practical_is_llvm_really/ https://old.reddit.com/r/ProgrammingLanguages/comments/hhxis...
- rapsey 6y agoChromium 5h+
- secondcoming 6y agoIt took my 4-core i4790K ~4 hours to compile tensorflow. Part of the build process builds LLVM...
- rurban 6y agoLike with Scala. Over 5 minutes for normal executable sizes.
- oldmanhorton 6y agoChromium will easily take 5 or 6 hours for a clean build on a good professional workstation (i7/i9/low end xeon, 32-64GB RAM, nvme ssd).
- floatboth 6y agoHow?! I can build LLVM, Rust and Firefox in less time on my R7 1700. How is Chromium so bloated??
- Bjartr 6y agoIs guess because Google devs have Google infrastructure to accelerate & paralellize builds in a distributed manner. Build time ends up being a pretty low priority to improve when the primary contributors to the project don't have a problem with it.
- sgerenser 6y agoThis guy did it in 53 minutes on a 16-core 3950x with a fast ssd: https://textslashplain.com/2020/02/02/my-new-chromium-build-pc/ https://textslashplain.com/2020/02/02/my-new-chromium-build-... Not fast by any means but big difference between 6 hours and 1.
- zozbot234 6y ago> I just started working through the rust hello world. I was shocked that I had an exe in around 0.2s. It's not everything. It's projects that use a lot of monomorphized generics, or compile-time macros, etc. And to be sure, this situation is improving over time - as new generics-related features are added, hopefully more of the redundant code that gets output when using these features will simply be cleaned up automatically, without adverse impact on compile times.
- tym0 6y agoDepends what you're building, I have what I would consider a small server app (Less than 10 JSON HTTP endpoints with some postgres), a dev incremental build takes 17.21s and a release build 7m 12s. A similar app in Go would probably take less than a second to build, they're obviously quite different languages but that doesn't feel that fast.
- xrisk 6y agoIs that because the libraries you link to are gigantic? Even so, the compiler shouldn’t be compiling those parts of the libraries that aren’t being used, right?
- tym0 6y agoActix, Diesel, Serde and their dependencies are definitely most of build time.
- pjmlp 6y agoSo far cargo doesn't do binary dependencies, so when you start a project, or do CI/CD, it compiles the all world from scratch.
- chc 6y agoI'm not intimately familiar with the internals of rustc, but my impression was that everything gets compiled and dead code is later eliminated. In order to avoid compiling unnecessary stuff, you generally need to use feature flags (e.g. you can say "only compile this if the serialization feature is enabled").
- cptskippy 6y agoI'm looking at the pipeline for smallish .NET Core Web App and the 6 projects build vary from 4-25sec each to build and with all the scaffolding it takes just under 5 minutes start-to-finish to produce binaries.
- qppo 6y agoPull in serde and run a non incremental release build
- YorickPeterse 6y agoTo illustrate, let's take the following VM code: https://gitlab.com/inko-lang/inko/-/tree/master/vm https://gitlab.com/inko-lang/inko/-/tree/master/vm. This VM consists of 18 262 lines of code, including VM tests. An incremental release build where nothing has changed (I just ran `touch src/lib.rs`) takes 25 seconds. Compiling the VM from scratch including all dependencies takes 1 minute and 28 seconds. That's not too bad, but it could (and in my opinion should be) much better. Debug builds are usually faster to compile, but tend to run too slowly to be useful for anything but debugging some VM bug.
- staticassertion 6y agobuilds for my 10kLOC project, which is a workspace. These are the commands run from the root of the workspace. We could clean up some deps, we use quite a few crates, and we use a number of proc macros as well. In general I'd say we're fairly "worst case" for compile time. cargo clean; cargo build; 4m20 Commenting out two lines of code in one of the services + cargo build; 0m14s cargo clean; cargo build --release 11m43s change 2 lines, cargo build --release 0m31s I don't find this egregious. ChromeOS Linux, which is debian Intel i7 4 core 32GB RAM