rustc-perf
rustc_codegen_cranelift
Our great sponsors
rustc-perf | rustc_codegen_cranelift | |
---|---|---|
26 | 44 | |
588 | 1,404 | |
4.8% | 5.6% | |
9.7 | 9.7 | |
6 days ago | 6 days ago | |
Rust | Rust | |
- | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rustc-perf
-
Adding runtime benchmarks to the Rust compiler benchmark suite
> what do people use to run benchmarks on CI?
Typically, you purchase/rent a server that does nothing but sequentially run queued benchmarks (and the size/performance of this server doesn't really matter, as long as the performance is consistent), then sends the report somewhere for hosting and processing. Of course, this could be triggered by something running in CI, and the CI job could wait for the results, if benchmarking is an important part of your workflow.
But CI and benchmarks really shouldn't be run on the same host.
> What does the rust project use?
It's not clear exactly where the Rust benchmark "perf-runner" is hosted, but here are the specifications of the machine at least: https://github.com/rust-lang/rustc-perf/blob/414230abc695bd7...
> What do other projects use?
Essentially what I described above, a dedicated machine that runs benchmarks. The Rust project seems to do it via GitHub comments (as I understand https://github.com/rust-lang/rustc-perf/tree/master/collecto...), others have API servers that respond to HTTP requests done from CI/chat, others have remote GUIs that triggers the runs. I don't think there is a single solution that everyone/most are using.
-
Can Rust's compile time match its runtime performance?
hmm really really hard to answer :'), it's tradeoffs I think, no matter what you think Rust (cmiiw, I'm not qualified to say this) has (and probably in the future will adds more with guards on compiler metrics https://perf.rust-lang.org/) several phases that given the diffs to other language, might not available to any language compiler out there, if it's available I think rustc already did their best in here (some already being parallized etc etc, might be wrong since I can't refs any reference MRs, but it does exists though labels regarding this)
-
How to catch performance regressions in Rust
About a year ago I was looking for a tool like Rust perf for my application code. I did some research and found a lot of prior art. However, nothing checked all the boxes I was looking for, so I built Bencher!
- Rust – Are We Game Yet?
-
Next Rust Compiler
https://www.pingcap.com/blog/rust-compilation-model-calamity... is a good overview. In general it varies depending on the crate but we track the performance at https://perf.rust-lang.org/ - if you look at cargo, for example, over 60% of the time is spent in codegen through LLVM: https://perf.rust-lang.org/detailed-query.html?commit=222d1f...
- Data-driven performance optimization with Rust and Miri
-
Generic associated types to be stable in Rust 1.65
Something like https://perf.rust-lang.org/?
-
This Week in Rust #463
The performance full-report link is dead: https://github.com/rust-lang/rustc-perf/blob/master/triage/2022-10-04.md
-
Are these misconceptions about rust?
Looking for better arguments, rustc might generate better IR because the compiler is more mature, has much more manpower, and has its performance [closely monitored[(https://perf.rust-lang.org/) and triaged. Zigc might generatte better IR because the language might be easier to generate IR for.
-
Show HN: Rust test harness that measures energy consumption
At the end of the day most people care about wall clock time. It's a real physical value that's easy to understand and easy to compare between systems. Plus, if two functions execute say, 1 billion instructions each, but one spends extra time stalled waiting for data fetches from RAM or doing IO, you definitely want to account for that in normal benchmarking.
Instruction counting is more of a specialized tool but I like to use it whenever I can because it has low variance and makes comparing changes a lot easier. Compare how bumpy these graphs are for instruction count (first link) and wall clock time (second link):
https://perf.rust-lang.org/?start=&end=&kind=raw&stat=wall-t...
rustc_codegen_cranelift
-
Cranelift code generation comes to Rust
Windows is supported. See https://github.com/rust-lang/rustc_codegen_cranelift/issues/....
-
A Guide to Undefined Behavior in C and C++
> When this happens, it seems like it'll be possible to get the LLVM bits out of the bootstrap process and lead to a fully self-hosted Rust.
What do you mean by "when this happens"? GP's point is that this has already happened: the Cranelift backend is feature-complete from the perspective of the language [0], except for inline assembly and unwinding on panic. It was merged into the upstream compiler in 2020 [1], and a compiler built with only the Cranelift backend is perfectly capable of building another compiler. LLVM hasn't been a necessary component of the Rust compiler for quite some time.
-
What are some stuff that Rust isn't good at?
Note that the Cranelift codegen will eventually become standard for debug builds to speed them up.
-
Rust port of B3 from WebKit, LLVM-like backend
Maybe one day we'll have rustc b3 backend like what they did with Cranelift
-
Any alternate Rust compilers?
Additionally, there is gcc codegen for rustc (https://github.com/rust-lang/rustc_codegen_gcc), which is not a compiler per se, but an alternative code generator, with more architectures supported and other nice things. It's also coming along, but there's still a lot of work to do there too. There's also Cranelift codegen (https://github.com/bjorn3/rustc_codegen_cranelift), which is designed to make debug builds faster, but this is not as exciting/useful as the other 2.
-
Capsules, reactive state, and HSR: Perseus v0.4.0 goes stable!
For the instant reloading, that's in Sycamore, so you should speak to its devs, but as for the alternative compiler backend, it's not my project, but it uses Cranelift and works pretty well! See https://github.com/bjorn3/rustc_codegen_cranelift for details.
- Security Engineer looking for ways to see if any of my tasks could slowly be ported to Rust or should I just stick with Python.
-
Improving Rust compile times to enable adoption of memory safety
Cranelift is not used for debug builds by default. I think that's probably a goal (although I'm not actually 100% sure about that just because I'm not dialed into what the compiler team is doing). Even the OP mentions this:
> We were able to benchmark bjorn3's cranelift codegen backend on full crates as well as on the build dependencies specifically (since they're also built for cargo check builds, and are always built without optimizations): there were no issues, and it performed impressively. It's well on its way to becoming a viable alternative to the LLVM backend for debug builds.
And the Cranelift codegen backend itself is also clear about it not being ready yet: https://github.com/bjorn3/rustc_codegen_cranelift
(To be clear, I am super excited about using Cranelift for debug builds. I just want to clarify that it isn't actually used by default yet.)
The more immediate goal of "distribute the cranelift backend as a rustup component" has been making good progress and seems like it might happen relatively soon https://github.com/bjorn3/rustc_codegen_cranelift/milestone/...
What are some alternatives?
zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
wasmtime - A fast and secure runtime for WebAssembly
gccrs - GCC Front-End for Rust
tch-rs - Rust bindings for the C++ api of PyTorch.
sccache - Sccache is a ccache-like tool. It is used as a compiler wrapper and avoids compilation when possible. Sccache has the capability to utilize caching in remote storage environments, including various cloud storage options, or alternatively, in local storage.
cranelift-jit-demo - JIT compiler and runtime for a toy language, using Cranelift
mrustc - Alternative rust compiler (re-implementation)
Fable: F# |> BABEL - F# to JavaScript, TypeScript, Python, Rust and Dart Compiler
foth - Tutorial-style FORTH implementation written in golang
rust-mini-games - Mini games made in Rust
gdnative - Rust bindings for Godot 3
glTF-Sample-Models - glTF Sample Models