Обложка канала

Technologic

Posts by deeply involved developers about various aspects of FOSS technologies, Linux, programming, security, infrastructure solutions and DevOps practices

Technologic

7 лет назад
Открыть в
Breakthrough and crucial leap forward for Rust and Tokio

This November was really exciting for the Rust community!

async/.awat (new syntax for asyncronous code execution with zero-cost futures under the hood, which is in turn, correspondingly, based on epoll model of passive calls to handler functions by arisen events, i.e. based on more cost effective, truly zero-cost, lazy evaluation model of computations and state changes) and NLL (non-lexical lifetimes, new borrow & ownership checker, based on control flow and data flow lifetimes analysis in more low-level intermediate MIR byte code, not the syntax tree analysis as it was before) reached the stable state/branch and released in stable 1.39 compiler version!

https://blog.rust-lang.org/2019/11/07/Rust-1.39.0.html

https://blog.rust-lang.org/2019/11/07/Async-await-stable.html

https://blog.rust-lang.org/2019/11/01/nll-hard-errors.html

So, thus, in the next couple of months we will see how will increased the user base of Rust, the networking projects diversity in ecosystem and how the community will grow up in the near future due to this essential features, finally delivered into stable branch in these last two months.

Here is the really good articles, which describes how the futures, the "handler pyramid of doom" and it's asynchronous destructors are works and optimized under the hood of async/.await:

https://tmandry.gitlab.io/blog/posts/optimizing-await-1/

https://tmandry.gitlab.io/blog/posts/optimizing-await-2/

https://boats.gitlab.io/blog/post/poll-drop/


The Tokio had reached the 0.2 version!

https://tokio.rs/blog/2019-11-tokio-0-2/

Why it's so important? Just take a look at the new work-stealing thread scheduler (M:N thread mapper, which uses work-stealing model for more optimal CPU cores load and maps program asynchronous threads to system threads pool, dedicated to execute the program, which is in turn managed by the kernel and mapped to CPU cores, accordingly) in Tokio - that's a huge step forward! Initial testing using Hyper (raw http library) shows a 30%+ speed up!

https://tokio.rs/blog/2019-10-scheduler/

https://github.com/tokio-rs/tokio

We expect some movements up in the tournament table of the TechEmpower continuous frameworks benchmarks, so watch the results here:
https://tfb-status.techempower.com

Previous posts in a thread:

@technologique/1423

@technologique/1417

@technologique/1418

@technologique/1406

#Rust