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


Google Releases Gemma Open Models
28/02/2024

Google has released a set of lightweight open models that have been built from the same research and technology used to create Google's recent Gemini models.



Edgeless Systems Announces Continuum AI
14/03/2024

Edgeless Systems has announced the launch of Continuum, a  security solution that provides cloud-based "Confidential AI" services and enables sharing of sensitive data with chatbots such as ChatG [ ... ]


More News

 

raspberry pi books

 

Comments




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