Rust 1.23 Uses Less Memory
Written by Kay Ewbank   
Thursday, 11 January 2018

There's a new version of Rust that uses less memory and no longer makes unnecessary copies.  The documentation has also been changed to use CommonMark.

Rust was originally sponsored by Mozilla, and is designed to be safe, fast and concurrent without having a garbage collector. It uses innovative means to make system programming safe by the language being constructed in such a way that problems can be detected at compile time. Intended uses include embedding in other languages, writing programs with specific space and time requirements, and writing low-level code, like device drivers and operating systems. 

The changes to this latest version start with the avoiding of making unnecessary copies of arguments that are simple bindings. The problem arose because in the past MIR (Rust's Mid-level Intermediate Representation of a program) differentiated between arguments and locals. This meant there was a need to add extra copies assigning the argument to a local, even for simple bindings. MIR has been changed so it no longer differentiates, but until now the copies have continued to be created, bloating the MIR and LLVM IR that the compiler emits. This has now been corrected.

This has resulted in a five to ten per cent drop in memory usage in the tests run by the developers, though they say your mileage may vary.

The other main change to this release is that rustdoc has been moved to use CommonMark. Until now, rustdoc never guaranteed which markdown rendering engine it used, but the developers have now committed to using CommonMark. The change isn't complete yet as the documentation in this release is being rendered with the previous renderer, Hoedown, as well as with a CommonMark compliant renderer.

This release also sees the addition of some new stabilized APIs:

  • The various std::sync::atomic types now implement From their non-atomic types. For example, let x = AtomicBool::from(true);.
  • () now implements FromIterator<()>;
  • RwLock<T> has had its Send restriction lifted

rust

 

More Information

Rust Website

Related Articles

 Rust 1.20 Adds Associated Contents

Rust 1.16

Updated Rust Improves Documentation

Rust 1.6 Released

Rust 1.3 Released

Rust Releases New Versions

Rust Hits Stable 1.0 - So What?

Rust 1.0 Alpha Released       

Rust Reaches 0.9

Rust 0.7 Released

Rust 0.4 Full Integration of Borrowed Pointers

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

 

Banner


APISEC Conference Sessions Now Available Online
12/07/2024

The talks from APISEC|CON, the largest event dedicated to API security, are now available up on Youtube, for free. The virtual event covered AI and LLM security, defending APIs, API sprawl, gover [ ... ]



Udacity Offers More AWS Scholarships
28/06/2024

Udacity has announced it is accepting applications for the next wave of 1,000 AWS AI & ML Scholarships. Any student over the age of 16 who self-identifies as under-served or under-represented in t [ ... ]


More News

 

kotlin book

 

Comments




or email your comment to: comments@i-programmer.info