Readit News logoReadit News
nnethercote commented on How to speed up the Rust compiler   nnethercote.github.io/202... · Posted by u/mfrw
thraway3837 · 2 years ago
The author is a member of the Rust team. https://nnethercote.github.io/about-me.html

Their blog posts are also posted multiple times on Hacker News by different identities.

https://news.ycombinator.com/from?site=nnethercote.github.io

Seems odd that this wouldn’t go into an official Rust blog when you’re a member of the team and instead published on your personal domain and blog.

nnethercote · 2 years ago
I'm a member of Futurewei's Rust team, and I'm in the Compiler Contributors group.

I started these posts back in 2016 when I wasn't a member of either. It's been a long-running series, and there's never been much reason for them to go on the official Rust blog, because they get enough attention on my personal blog.

In the past I have posted links to Hacker News but usually they don't make the front page and get few if any comments, so I stopped bothering, but others sometimes do. I always post to /r/rust where the level of discussion tends to be higher-quality than HN, because there is a higher level of Rust knowledge.

nnethercote commented on How to speed up the Rust compiler   nnethercote.github.io/202... · Posted by u/mfrw
Rusky · 2 years ago
This doesn't feel like the same thing. The performance benefits of an RDBMS come from the way its storage is organized and (at least in typical RDBMS scenarios) the way queries are dynamically optimized to traverse that storage, based on the data it contains.

The thing rustc calls "queries" is more about incremental compilation- reusing work within and across compiler invocations, but without the sort of impact on memory layout and access patterns that you get from an RDBMS.

The closest thing I've seen in a compiler is rather Zig's AST memory layout work: https://github.com/ziglang/zig/pull/7920. But this is a very "hand-crafted" version of what an RDBMS does.

nnethercote · 2 years ago
I've tried AST memory layout work in the Zig style, look for "shrinkage" in these two posts:

- https://nnethercote.github.io/2022/10/27/how-to-speed-up-the...

- https://nnethercote.github.io/2023/03/24/how-to-speed-up-the...

It's hard work. Small AST changes often require hundreds of changes to the code. The required changes usually make the AST less ergonomic to work with. And the perf benefits I obtained were very small. Even after shrinking `ast::Expr` (by far the most common AST node kind) from over 100 bytes to 64 bytes on 64-bit.

The linked Zig PR has very impressive reductions in walltime/cycles/etc. but if you read closely it's restricted just to parsing, which is usually a very small slice of compile time, at least for rustc. My experience with these kinds of changes was disappointing. I concluded "I’d love to be proven wrong, but it doesn’t feel like this work is taking place in a good part of the effort/benefit curve."

nnethercote commented on FloatZone: Accelerating Memory Error Detection Using the Floating Point Unit [pdf]   download.vusec.net/papers... · Posted by u/luu
carlmr · 2 years ago
This looks really cool! Can we try it out somewhere? I don't see any download link.
nnethercote commented on FloatZone: Accelerating Memory Error Detection Using the Floating Point Unit [pdf]   download.vusec.net/papers... · Posted by u/luu
nnethercote · 2 years ago
I just want to say that this is a very weird but cool approach that I never would have thought of. Nice work!
nnethercote commented on Codegen Units in the Rust Compiler   nnethercote.github.io/202... · Posted by u/dtwwtd
dtwwtd · 2 years ago
Ah sorry, looks like I got ahead of myself due to my feed reader picking up the post this morning!
nnethercote · 2 years ago
No problem, I learned that I shouldn't post drafts and assume they will go unnoticed :)
nnethercote commented on Codegen Units in the Rust Compiler   nnethercote.github.io/202... · Posted by u/dtwwtd
nnethercote · 2 years ago
The link above is to a draft version of the blog post, which is no longer available.

The final version (which has a different title) is at https://nnethercote.github.io/2023/07/11/back-end-parallelis....

A HN post about the final version is at https://news.ycombinator.com/item?id=36675281.

nnethercote commented on The Rust Performance Book (2020)   nnethercote.github.io/per... · Posted by u/greenSunglass
bestouff · 3 years ago
The part where it says that parking_lot's Mutex is faster then std's is obsolete since 1.62.0 IIRC.
nnethercote · 3 years ago
Thanks for the suggestion!

u/nnethercote

KarmaCake day3688July 5, 2011View Original