Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Rust 1.2 Brings Faster Compilation, Parallel Code Generation, and More

Rust 1.2 Brings Faster Compilation, Parallel Code Generation, and More

This item in japanese

The Rust Core Team has announced the availability of the Rust 1.2 stable and 1.3 beta releases. Rust 1.2 focuses mainly on tooling, improving compiler performance and introducing parallel code generation. Furthermore, it introduces support for the MSVC toolchain.

Here the most relevant changes;

  • Faster compilation: Rust 1.2 brings developers a compilation time speedup of about 30% on benchmark compilation. On real-world projects taken from Rust package repository, Crates, performance saw an improvement by a 1.16x–1.62x factor depending on the target project.

  • Parallel coge generation: mostly useful for debug builds, parallel code generation brings a 33% spueedup when bootstrapping on a 4 core machine. Activating parallel code generation will prevent some optimizations and make it equivalent to using a -O1 flag.

  • Cargo: Rust’s package manager has also got improved performance, in two cases specifically: when doing a build that do not require any recompilation; and when using shared target directories in large projects, which make it possible to cache common dependencies.

  • MSVC toolchain support: starting with Rust 1.2, the Rust compiler is able to link using the native Windows toolchain, whereas in previous versions mingw was used. Additionally, the MSVC platform is now a first-tier platform, which means that all rust-lang crates are tested on it.

  • Language changes: most relevant is full support for dynamically-sized types, with the addition of dynamically-sized type coercion. Dynamically-sized types are types whose size is unknown to the compiler, such as [T], which represents a number of sequentailly laid-out instances of T, and Trait, which represents a type T that implements the trait Trait. Dynamically-sized types were already present in Rust 1.0, and Rust 1.2 completes their implementation by allowing smart pointers to apply to existential types such as [T] and Trait.

As to Rust 1.3 beta, it will also bring better performance, mainly improving things within the standard library. Furthermore, Rust 1.3 adds preliminary support for Windows XP, although XP is not considered to be in the “first tier”.

More details about Rust 1.2 can be found in the release notes.

Rate this Article


Educational Content