The Rust Core team recently announced the official release of Rust 1.2. Rust is a new programming language aiming to make it easier to build reliable, efficient systems. Rust combines low-level control over performance with high-level convenience and safety guarantees
Rust 1.2 comes with two major performance improvements for the compiler:
- An across-the-board improvement to real-world compiler performance. Representative crates include hyper (compiles 1.16x faster), html5ever (1.62x faster), regex (1.32x faster) and rust-encoding (1.35x faster). You can explore some of this performance data at Nick Cameron’spreliminary tracking site, using dates 2015-05-15 to 2015-06-25.
- Parallel codegen is now working, and produces a 33% speedup when bootstrapping on a 4 core machine. Parallel codegen is particularly useful for debug builds, since it prevents some optimizations; but it can also be used with optimizations as an effective -O1 flag. It can be activated by passing -C codegen-units=N to rustc, where N is the desired number of threads.
Cargo’s performance has also improved dramatically:
- Builds that do not require any recompilation (“no-op builds”) for large projects are much faster: for Servo, build time went from 5 seconds to 0.5 seconds.
- Cargo now supports shared target directories that cache dependencies across multiple packages, which results in significant build-time reduction for complex projects.
The 1.2 release also introduces support for the MSVC (Microsoft Visual C) toolchain, as opposed to GNU variants. The upshot is that Rust code is now directly linkable against code built using the native Windows toolchain. The compiler bootstraps on MSVC, we have preliminary nightlies, and we are testing all rust-lang crates against MSVC. Unwinding support is not yet available (the process aborts on panic), but work is underway to land it.
On the language side, Rust 1.2 marks the completion of the dynamically-sized type (DST) work, allowing smart pointers like Rc to seamless apply to arrays and trait objects, so that Rc<[T]> is fully usable. This final enhancement applies to all smart pointers in the standard library. Support for external smart pointer types is available in nightlies, and will be stabilized soon.comments powered by Disqus