Blog about programming stuff.| Kobzol’s blog
TL;DR: #[derive(From)] can be used in nightly now. See here on how to use it. You can follow this tracking issue for more updates.| Kobzol’s blog
Recently, I found myself struggling with a small annoyance related to struct field visibility and struct initialization in Rust. It’s no rocket science, but I thought about it long enough that I might as well turn it into a blog post.| Kobzol’s blog
Perhaps the most often repeated complaint about Rust is its slow feedback loop and long compilation times. I hear about it all the time; in Rust podcasts, blog posts, surveys, conference talks or offline discussions. I also regularly complain about it, being a Rust user myself!| Kobzol’s blog
Disk usage of the target directory is a commonly cited annoyance with Rust (and Cargo) – in the last year’s Annual Survey, it was the third most pressing issue of Rust users, right after slow compilation1 and subpar debugging experience. Given the “build everything from source” compilation model of Rust, and both debuginfo and incremental compilation being enabled by default in the dev Cargo profile, it is unlikely that the target directory will ever become lean and small. However, th...| Kobzol’s blog
This blog post is essentially a PSA on how you can easily improve dev incremental rebuild performance.| Kobzol’s blog
Blog about programming stuff.| Kobzol’s blog
Does the following sound familiar to you?| Kobzol’s blog
Last year, while I was browsing through Rust compiler pull requests, I noticed #126013, which added the unreachable_pub lint to several crates of the compiler. This piqued my interest, because I did not know that lint at the time. But when I examined its description, I was quite surprised, become the lint made absolutely no sense to me! After I discussed this with the author of the PR1, I realized that the way I think about visibility in Rust is perhaps a bit strange, or at least different fr...| Kobzol’s blog
This is a short appreciation post about Rust continuously guiding me towards doing The Right Thing™.| Kobzol’s blog
…Yes, I know that the title looks like a clickbait. But it’s actually not that far from the truth :)| Kobzol’s blog
Recently I encountered a bug so cute that I immediately knew that I will want to share it on my blog. It was one of those bugs that even Rust can’t save you from. It occurred in HyperQueue (HQ), a distributed task scheduler written in Rust that I work on.| Kobzol’s blog
TLDR: I think that the primary benefit of async/await is that it lets us concisely express complex concurrency; any (potential) performance improvements are just a second-order effect. We should thus judge async primarily based on how it simplifies our code, not how (or if) it makes the code faster.| Kobzol’s blog
I’m still recovering from the most hectic semester of my life1, so I wasn’t yet able to push out the several blog posts that I have in the pipeline. So this is just a short post in which I wanted to share a bunch of Rust exercises that I created during the first run of a Rust university course that I was teaching at my university this semester. Most hectic semester so far… ↩| Kobzol’s blog
I haven’t been blogging for the past ~eight months, because I was quite busy finishing my PhD thesis. I have finally submitted it by the end of August, and as of today, I have also succesfully defended it, which marks the end of my six (!) years1 long PhD study in the area of High-Performance Computing and Computer Science. My PhD study officially began on 30th August 2018, so the total study duration was in fact even longer than six years. ↩| Kobzol’s blog
TL;DR: I created a Cargo subcommand called cargo-wizard that simplifies the configuration of Cargo projects for maximum runtime performance, fastest compilation time or minimal binary size.| Kobzol’s blog
As part of my PhD studies, I’m working on a distributed task runtime called HyperQueue. Its goal is to provide an ergonomic and efficient way to execute task graphs on High-Performance Computing (HPC) distributed clusters, and one of its duties is to be able to spawn a large amount of Linux processes efficiently. HyperQueue is of course written in Rust1, and it uses the standard library’s Command API to spawn processes2. When I was benchmarking how quickly it can spawn processes on an HPC...| Kobzol’s blog
Have you ever tried to compile a helloworld Rust program in --release mode? If yes, have you seen its binary size? Suffice to say, it’s not exactly small. Or at least it wasn’t small until recently. This post details how I found about the issue and my attempt to fix it in Cargo.| Kobzol’s blog
TL;DR: On Linux, if you have Transparent Huge Pages enabled, you can try to run cargo with the environment variable MALLOC_CONF="thp:always,metadata_thp:always" for a potential ~5% speed boost.| Kobzol’s blog
TL;DR: This post describes LLVM optimization remarks that can useful to help the compiler better optimize your programs. If you want to analyze remarks generated from compiling Rust programs, you can use the cargo-remark tool.| Kobzol’s blog
In my recent post about the Rust compiler CI (continuous integration) and benchmarking infrastructure, I have promised to write a blog post about runtime benchmarks, which is a new addition to the benchmark suite of the Rust compiler. However, I realized that before doing that, it might be a good idea to first describe how does the benchmark suite actually work, what are its components and how is it used by the Rust compiler (rustc) developers, to introduce the necessary context. So, runtime ...| Kobzol’s blog
During the first half of 2023, I have continued my quest for optimizing the build, test and performance monitoring infrastructure of the Rust compiler. This post describes what has been done in this area, and serves a follow-up to my previous post on this topic. Note that possibly the biggest sub-project that I have worked on was the implementation of runtime benchmarks for the Rust benchmark suite, however I will dedicate a separate blog post for that (which I will hopefully publish in the n...| Kobzol’s blog
Last year I was working on improving the Profile-guided optimization (PGO) workflow used to build the Rust compiler. While doing that, I realized that while PGO works fine for Rust, it is not as straightforward to use and as discoverable as I would have liked. That led me to the creation of cargo-pgo, a Cargo subcommand that makes it easier to optimize Rust binaries with PGO (and BOLT, see below).| Kobzol’s blog
You can check out a YouTube recording of a talk based on this blog post.| Kobzol’s blog