


















Today marks the completion of the Rust 1.2 stable and 1.3 beta release cycles! Read on for the highlight, or check the release notes for more detail.
As we previously announced, 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's preliminary 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.
One of the most exciting developments during the 1.3 cycle was the introduction of the Rustonomicon, a new book covering "The Dark Arts of Advanced and Unsafe Rust Programming". While it's still in its early days, this book already provides indispensable coverage of some of Rust's more subtle aspects.
The 1.3 cycle also saw additional focus on performance, though most wins here are within the standard library:
Vec::resize and Read::read_to_end.Read::read_to_end has been
specialized for stdin and File,
resulting in additional speedups.PartialEq implementation on slices is now
much faster.We have also made strides in our Windows support, landing preliminary support for targeting Windows XP. While we do not intend to treat Windows XP as a "first tier" platform, it is now feasible to build Rust code for XP as long as you avoid certain parts of the standard library.
On the Cargo front, we have landed support for lint capping as specified by an earlier RFC. The idea is that lints in your dependencies should not affect your ability to compile cleanly, which in turn makes it easier to tweak the way lints work without undue hassle in the ecosystem.
The 1.2 stable release represents the hard work of 180 fine folks:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。