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



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.



Azure AI And Pgvector Run Generative AI Directly On Postgres

It's a match made in heaven. The Azure AI extension enables the database to call into various Azure AI services like Azure OpenAI. Combined with pgvector you can go far beyond full text search. Let's  [ ... ]

Apache Superset 4 Updates Reports

Apache Superset 4 has been released with improvements to the reporting module and redesigned alerts. Superset is a business intelligence web application. It is open source, provides data exploration a [ ... ]

More News


raspberry pi books



or email your comment to: