Kobzol
kobzol.github.io · Personal blog · on HN since 2020
Jakub Beránek (Kobzol), a Rust compiler contributor, writes about Rust performance, compile times, binary size, and async Rust.
What HN saysCommenters recommend his posts as interesting and detailed, and cite them on what makes rustc slow, the benchmark suite, and building for older glibc.
40HN people shared it
15linked it in comments
57stories submitted
1.4Kstory points
3 months agolast shared
2020people per year2026
Most-shared posts
- 1Making Rust binaries smaller by default6 people · 248 points · first shared 2024 · 194 comments on HN
- 2Async Rust is about concurrency, not (just) performance4 people · 13 points · first shared 2025 · 2 comments on HN
- 3Write Python like it's Rust (correct link)4 people · 3 points · first shared 2023 · discussion on HN
- 4Rust compiler performance3 people · 305 points · first shared 2025 · 260 comments on HN
- 5What part of Rust compilation is the bottleneck?3 people · 125 points · first shared 2024 · 61 comments on HN
- 6Process Spawning Performance in Rust3 people · 41 points · first shared 2024 · 1 comments on HN
- 7Building Rust binaries in CI that work with older GLIBC3 people · 4 points · first shared 2021 · 1 comments on HN
- 8Investigating and fixing a nasty clone bug3 people · 3 points · first shared 2025 · discussion on HN
- 9Just write a test for it2 people · 74 points · first shared 2025 · 61 comments on HN
- 10Speeding up the Rust compiler without changing its code2 people · 69 points · first shared 2022 · 4 comments on HN
- 11Reducing Cargo target directory size with -Zno-embed-metadata2 people · 53 points · first shared 2025 · 14 comments on HN
- 12Two ways of interpreting visibility in Rust2 people · 5 points · first shared 2025 · discussion on HN
- 13Adding [Derive(From)] to Rust2 people · 5 points · first shared 2025 · discussion on HN
- 14Optimizing Rust programs with PGO and BOLT using cargo-pgo2 people · 3 points · first shared 2023 · discussion on HN
- 15Reducing binary size of (Rust) programs with debuginfo2 people · 3 points · first shared 2025 · discussion on HN
What HN people wrote when they linked it
yu3zhou4 · 2024-03-16
FWIW Jakub has more blog posts on his website which are also really interesting https://kobzol.github.io/
kapilsinha · 2024-03-19
I appreciate this detailed explanation! To preface, I took on macro expansion caching because it was a clear solution for the slow builds I saw in some projects (taking the "project-specific" approach I mentioned in the blog). That said, my medium-term vision for CodeRemote isn't to develop a superior closed-source Rust compiler fork; instead, it is to provide remote tooling for faster development (i.e. bring small dev teams' tooling up closer to Google's level):
(a) pre-configured build servers, so a developer doesn't need to be equipped with the latest Mac to be functional
(b) shared cache within a developer team
(c) potential avenues in CI/CD, testing, etc.
I'd love to hear your thoughts on this goal! Does some aspect address a development pain point of yours? I also want to address your points above, and I agree with lots of them:
1. I agree that especially in the wider Rust community, closed source is not a long-term solution. For what it's worth, I have been considering making the source available -- though likely not with a super copyleft license, at least initially. Do you think making the source available would alleviate people's safety concerns?
2. I have thought about the mold/sold linker quite a bit, especially because the author changed his license on sold from a commercial license to MIT. And defaults are indeed very powerful (this is discussed in a recent change to strip debug info by default,…
acemarke · 2021-10-26
I actually upgraded my team's Jest config to use https://github.com/Brooooooklyn/swc-node a few weeks ago. However, our Jenkins CI agents run RHEL7, and neither of the Linux binary targets would run. The `x64-gnu` binary needed a `GLIBC_2_23` symbol when only 2.18 was available, and the `x64-musl` binary had no `musl-libc` on the machine. I don't own the Jenkins agents, so I couldn't install other deps myself.
I ended up building `musl-libc` from source on another RHEL7 agent, committed the `.so` to our repo, and added that to the `LD_LIBRARY_PATH` in our Jenkinsfile, and actually got that working.
I did see some mentions that Rust could build to target an older GLibc ( https://kobzol.github.io/rust/ci/2021/05/07/building-rust-binaries-in-… ), so I'm curious if Next is going to use copies of SWC built that way for better compat or if it will require more workarounds on my part.
I can definitely see shipping a WASM version as a great workaround to those sorts of compat issues.
afdbcreid · 2026-07-29
See https://kobzol.github.io/rust/rustc/2024/03/15/rustc-what-takes-so-lon… which does an extensive analysis on that.
kibwen · 2026-01-16
Those are graphs of averages from across the benchmarking suite, which you can read much more information about here: https://kobzol.github.io/rust/rustc/2023/08/18/rustc-benchmark-suite.h…
throawayonthe · 2025-10-18
kobzol · 2025-02-24
The stdlib already mostly does all of that :)
Check out https://kobzol.github.io/rust/2024/01/28/process-spawning-performance-…
Voklen · 2024-02-18
I believe the extra size before stripping is because Rust ships the standard library with debug symbols included by default (for now)
Source: https://kobzol.github.io/rust/cargo/2024/01/23/making-rust-binaries-sm… HN discussion: https://news.ycombinator.com/item?id=39112486
nindalf · 2024-02-18
Check out Making Rust binaries smaller by default (https://kobzol.github.io/rust/cargo/2024/01/23/making-rust-binaries-sm… Previously discussed a few weeks ago at https://news.ycombinator.com/item?id=39112486.
That change will be live on 21st March, so manual strips won't be required after that.
BD103 · 2024-02-05
Rust binaries seem to be larger than they should be, though. I believe Kobzol [1] has been making some work on that.
[1]: https://kobzol.github.io/rust/cargo/2024/01/23/making-rust-binaries-sm…
oldelpaso66 · 2023-06-29
There was another one of these posts floating around recently https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-it…
My personal experience is that while this would be a really good way of getting people to write quality Python code, a lot of python users (data scientists) are not software engineers and don't have the discipline to do this without very strict PRs
baggiponte · 2023-05-20
spoiler · 2022-09-16
I personally doubt you'll get anything out of this route, but maybe I'm not seeing a line of reasoning that led to this.
On a more helpful note, I'd check out a few books (try https://hackernewsbooks.com) and then pick a subject/domain you find interesting and create a small project to use as a learning medium.
Also, to tinker with assembly you could start with simple but interactive processor and assembly simulators/emulators; there are a few web ones floating around like https://schweigi.github.io/assembler-simulator/ or https://kobzol.github.io/davis/ but there are also more graphical ones too. Later you can maybe move to more serious virtualization software like qemu
aw1621107 · 2026-06-01
> but I had heard that the compiler is slow (because it's doing so much thinking and checking in advance).
The compiler is indeed not particularly speedy, but the reason you were given is not entirely accurate. As measured in this blog post [0] different parts of the compilation pipeline will take different amounts of time depending on what you're doing (cargo check vs. incremental build vs. full build, building a library vs. binary, etc.), but generally speaking type/borrow checking take up relatively small portions of compilation time (~15% or less, based on eyeballing the charts [1, 2]) compared to everything else.
> one that's optimized for such tight loops, and another that does thorough checking
I think that would risk producing diverging language subsets, especially if the checks are essential for language semantics. For example, what exactly does it mean if a program passes the "relaxed" compiler but fails the "thorough" one? How close does that actually get you to a "real" working program?
[0]: https://kobzol.github.io/rust/rustc/2024/03/15/rustc-what-takes-so-lon…
[1]: https://kobzol.github.io/assets/posts/compile-sections/binaries.png
[2]: https://kobzol.github.io/assets/posts/compile-sections/libraries.png
networked · 2024-04-13
My experience has been different: last year I started writing Python again after a long break, and I am yet to regret using types pervasively. If some library has no type definitions, I prefer to have my typed code interact with its untyped code. It is still better than having no types at all. You can sometimes get some useful type safety by annotating your functions with the untyped library's classes.
Since then, I have used established libraries like Beautiful Soup, Jinja, Pillow, platformdirs, psutil, python-dateutil, redis-py, and xmltodict with either official or third-party types. I remember their types being useful to varying degrees and not a problem. I have replaced Requests with the very similar but typed and optionally async HTTPX. My most objectionable experience with types in Python so far has been having to write
root = cast( lxml.etree._Element, # noqa: SLF001 html5.parse(html, return_root=True), ) when I used types-lxml with https://github.com/kovidgoyal/html5-parser. In return I have been able to catch some bugs early and to "fearlessly"refactor code with few or no unit tests, only integration tests. The style I have arrived at is close to https://kobzol.github.io/rust/python/2023/05/20/writing-python-like-it…
Admittedly, I don't use Django. Maybe I won't like typed Django if I do. My choice of type checker is Pyright in non-strict mode. It seems to usually, though not always, catch more and more subtle type errors…