Daily Shaarli

All links of one day in a single page.

July 2, 2025

500× faster: Four different ways to speed up your code

The naive Rust implémentation is 10 times faster than the python one.
It remains 6 times faster than the optimized one.

The Python has a collections.Counter class that is approximately as fast as the naive Rust version.

The Fed says this is a cube of $1 million. They're off by half a million. - Calvin Liang
Ciarán McNally : « This is important to remember, especially in hard… » - mastodon.ie

A 2 part graph

On the left is a branched tree where the branches represent "life paths" where only one path is highlighted in green (the path you took) from root to tip (this is the past)

The right of the graph represents your future and you are at the base of a new branched tree where every pathway is green, representing the choices you have going forward.

Haralds Blog — Checked Exceptions are not Exceptional

There are 3 error or exception handling: unchecked exceptions (JS), Checked Exceptions (Go) or an integrated type (Result in Rust) that handle one case or the other.

Explicit is always better.
One thing with an integrated type, is the normal case and the other case. That's a great type to handle more than errors: a lookup of a key in a map, opening a file with a name for which there is no file is normal business. Maybe I will find more.

And for quality software, its function must be so blatantly obvious that everybody thinks: wow, this is trivial code, even a monkey could've programmed this.