-
Notifications
You must be signed in to change notification settings - Fork 299
Rust 1.12 release announcement #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
a441f0d
aebe579
33004e7
abbece1
c206abb
ddd38ea
8fb8644
fd4fb41
e91f3ab
0fac1e4
25ffdc6
3f643bf
74f3d78
c5d9c2a
1cc988b
71ffb96
0bed2fc
b8d46a9
6ed905b
4a34153
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,10 +31,10 @@ what you think of them: | |
 | ||
|
||
The largest internal change in this release is moving to a new compiler backend | ||
based on the new Rust [MIR]. While this feature does not result in any new | ||
user-visible features, it paves the way for a number of future compiler | ||
optimizations, and for some codebases it already results in improvements to | ||
compile times and reductions in code size. | ||
based on the new Rust [MIR]. While this feature does not result in anything | ||
user-visible, it paves the way for a number of future compiler optimizations, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe say: user-visible today |
||
and for some codebases it already results in improvements to compile times and | ||
reductions in code size. | ||
|
||
[previously talked]: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html | ||
[volunteer effort]: https://github.com/rust-lang/rust/issues/35233 | ||
|
@@ -54,17 +54,17 @@ declaration, you would see an error like the one below: | |
error](/images/2016-09-Rust-1.12/old-mismatched-trait-error.png) | ||
|
||
In the new error format we represent the error by instead showing the points in | ||
the code that matter the most. Here the relevant line in the trait declaration, | ||
and the relevant line in the implementation, using labels to describe why they | ||
don't match: | ||
the code that matter the most. Here is the relevant line in the trait | ||
declaration, and the relevant line in the implementation, using labels to | ||
describe why they don't match: | ||
|
||
 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use a screenshot which doesn't include the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jonathandturner mind sending a PR to my PR with new screenshots? |
||
|
||
Initially, this error design was built to aid borrow-checking errors, but we | ||
found, like the error above, the format can be broadly applied to a wide variety | ||
of errors. If you would like to learn more about the design, check out the | ||
[previous blog post on the subject][err]. | ||
Initially, this error design was built to aid in understanding borrow-checking | ||
errors, but we found, as with the error above, the format can be broadly | ||
applied to a wide variety of errors. If you would like to learn more about the | ||
design, check out the [previous blog post on the subject][err]. | ||
|
||
[err]: https://blog.rust-lang.org/2016/08/10/Shape-of-errors-to-come.html | ||
|
||
|
@@ -86,7 +86,7 @@ effort. | |
#### MIR code generation | ||
|
||
The new Rust "mid-level IR", usually called "MIR", gives the compiler a simpler | ||
way to think about Rust code than it's previous way of operating entirely on the | ||
way to think about Rust code than its previous way of operating entirely on the | ||
Rust abstract syntax tree. It makes analysis and optimizations possible that | ||
have historically been difficult to implement correctly. The first of many | ||
upcoming changes to the compiler enabled by MIR is a rewrite of the pass that | ||
|
@@ -95,17 +95,6 @@ effort the MIR-based backend has proved itself ready for prime-time. | |
|
||
TODO: Improve code complexity: size of old trans vs size of new trans. | ||
|
||
While for the most part this new backend is simply laying the groundwork for | ||
future improvements, this release does include one long-awaited refinement to | ||
the run-time representation of Rust types that results in both compile-time wins | ||
and runtime wins: the removal of "drop flags", AKA "non-zeroing drop", as | ||
specified in [RFC 320]. | ||
|
||
To maintain the semantics of Rust's `Drop` implementation, we always need to | ||
check whether a type must be dropped when it goes out of scope. Historically, | ||
this has been done by adding a special flag to all types that implement `Drop`, | ||
but this resulted in significant extra memory being used at runtime. | ||
|
||
MIR exposes perfect information about the program's control flow, so the | ||
compiler knows exactly whether types are moved or not. This means that it knows | ||
statically whether or not the value's destructor needs to be run. In cases where | ||
|
@@ -117,12 +106,12 @@ less bloat at runtime. | |
The improvements in compile times of some workloads due to this change alone are | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does "this change" refer to static drop, or to MIR trans? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @brson mentioned yesterday this was from the non-zeroing drop. Brian, can we confirm that? |
||
significant: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We may also want to say something to the effect "though not all workloads will see these improvements" or something to help set expectations. I don't want people to be like "but 1.12 doesn't compile my codebase 4.5x faster :( :(" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
|
||
| | 1.11 | 1.12 | compile time | | ||
|---------------|--------|-------|--------------| | ||
| inflate-0.1.0 | 10.17s | 4.32s | 2.35x faster | | ||
| hyper-0.5.0 | 24.03s | 5.23s | 4.58x faster | | ||
| hellworld | 0.17s | 0.14s | 1.20x faster | | ||
| regex 0.1.30 | 9.63s | 2.39s | 4.03x faster | | ||
| | 1.11 | 1.12 | compile time | | ||
|---------------|--------|-------|---------------| | ||
| inflate-0.1.0 | 10.17s | 4.32s | 2.35x faster | | ||
| hyper-0.5.0 | 24.03s | 5.23s | 4.58x faster | | ||
| helloworld | 0.17s | 0.14s | 1.20x faster | | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed |
||
| regex 0.1.30 | 9.63s | 2.39s | 4.03x faster | | ||
|
||
It is worth remembering that not all workloads may see this large of an | ||
improvement: it depends on a large number of factors. | ||
|
@@ -131,15 +120,6 @@ TODO: Future improvements. | |
|
||
TODO: non-zeroing drop PR https://github.com/rust-lang/rust/pull/33622 | ||
|
||
Compile times: | ||
|
||
| | 1.11 | 1.12 | % change | | ||
|---------------|--------|-------|----------| | ||
| inflate-0.1.0 | 10.17s | 4.32s | -57.5% | | ||
| hyper.0.5.0 | 24.03s | 5.23s | -78.2% | | ||
| helloworld | 0.17s | 0.14s | -16.4% | | ||
| regex.0.1.30 | 9.63s | 2.39s | -75.2% | | ||
|
||
[Memory usage](https://en.wikipedia.org/wiki/Resident_set_size): | ||
|
||
| | 1.11 | 1.12 | % of original size | | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the preview this image looks hella big :) We may want to scale it down a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
psssh loud and proud! :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, the other new error image is also a bit big (though not as big as this one)