2025-10-01 11:32:12
Another easy challenge in today's #AdventOfCode puzzle.
Part 1 is straightforward, and for part 2, the trick was to sort the list of ID ranges first, which made the merging pretty easy.
#AoC #AoC2025 #AdventOfCode2025 #rust #RustLang
"How to Optimize Rust for Slowness" – Carl Kadie
#rustlang
I wish there was a #JavaScript / #TypeScript package manager that behaved more like #RustLang's cargo. Specifically, in a workspace of many inter-dependent packages, I only want to f…
Sequoia PGP ukazuje wszystko to, co jest nie tak z #RustLang (nie czepiam się tu projektu Sequoia). Mamy kilka różnych binarek CLI, co ma sens.
Gdyby Sequoia była napisana w C, to najpewnie używałyby jakiejś biblioteki współdzielonej. Gdyby napisała była w Pythonie, to najpewniej mielibyśmy wspólną paczkę Pythona. Ale napisano ją w Ruście, więc każdy interfejs to odrębna, wielka binarka z włas…
Didn't feel like thinking too much for today's problem of #AdventOfCode, so my solution is quite naive and runs in a few tens of milliseconds for part 2 (thanks, #RustLang!).
I went for a HashSet for the grid just because it made looking up neighbours simpler at the edges, probably also not the most performant solution, but gets better as the grid becomes sparser.
#AoC #AoC2025 #AdventOfCode2025 #rust
Sequoia PGP exemplifies everything that's wrong about #RustLang (don't mean this against Sequoia). It features a bunch of different CLIs, which is a reasonable design.
If Sequoia were written in C, these CLIs would probably be using some shared library. If Sequoia were written in Python, they would probably use a shared Python package. However, it's written in Rust, so every CLI is a huge binary with its own copy of subset of shared Sequoia code, built separately:
-rwxr-xr-x 1 root root 12M 10-08 06:36 /usr/bin/gpg-sq
-rwxr-xr-x 1 root root 4,7M 10-08 06:36 /usr/bin/gpgv-sq
-rwxr-xr-x 1 root root 21M 10-08 08:38 /usr/bin/sq
-rwxr-xr-x 1 root root 6,9M 10-08 08:38 /usr/bin/sqop
-rwxr-xr-x 1 root root 3,1M 10-08 08:32 /usr/bin/sqv
Super happy with my solution for today's #AdventOfCode problem!
It initially took me a little bit of time to find a suitable strategy, but it all clicked when I noticed that the left-most selected digit had the most significance in the final value. Thus, I maximized the value of that left-most digit, leaving enough digits on the right side to be able to pick the required total number of batteries in the bank.
The solution is relatively short and sweet:
#AdventOfCode2025 #AoC #AoC2025 #RustLang #rust
"Do not introduce #NIH #RustLang dependencies in your #Python package when there's no performance, security or any other benefit to it, and it just limits portability and creates more work for packagers" challenge.
Difficulty: impossible.
#packaging
Today's #AdventOfCode problem was fun! I kept a different implementation for part 1 vs part 2 as they both run relatively fast.
For part 1, I iterated over all IDs (the ranges are quite small) and split them in half mathematically (no string representation) to compare both halves.
For part 2, I instead generated all interestings IDs (mathematically again) up to a length of 10 digits (the max in my input) and checked if any of the ranges contained them.
#AoC #AoC2025 #AdventOfCode2025 #RustLang #rust
New article on the blog!
This time, it's about how I optimized an algorithm which turns byte offsets into line/column numbers and UTF-16 offsets.
Most of the performance improvement came from the use of SIMD to efficiently count ASCII characters.
#rust #RustLang #SIMD #optimization #blog