news
Programming Leftovers
-
Andrew Nesbitt ☛ This Week in Package Management: 27 June 2026
Week six of the roundup, built from the package manager OPML feed collection and whatever I’ve posted or boosted on Mastodon.
-
MaskRay ☛ A deep dive into SmallVector::push_back
A fast/slow merge that rejoins after a call forces callee-saved spills onto the hot path, and shrink-wrapping can't remove them.
A tail-called out-of-line slow path removes the overhead.
Inliner behavior makes size effects are non-monotonic. -
Uwe Friedrichsen ☛ The essence of architectural work - Part 3
In the previous post, we discussed several architectural anti-patterns. We have seen that we are a lot more vulnerable to them if we do not understand why we do architectural work, i.e., understand its purpose. We understood that the focus and thus value of architectural work is accidental without having a clear understanding of why we are doing it.
Therefore, we will start looking at the purpose of architectural work in this post.
Over the years, I distilled three different facets regarding the purpose of architectural work 1: [...]
-
Łukasz Niemier ☛ Guards! Guards!
This behaviour is often surprising for a lot of Elixir developers, as it seemingly breaks commutative property of boolean operators. However, to be honest, these never were commutative because of short circuiting.
-
Weineng ☛ Data Access Patterns That Makes Your CPU Really Angry
Given an array of data, what is the slowest way to sum up the integers? Is it adding the numbers from left to right, adding them randomly, or doing something else? In this post, we are going to build a data access pattern from the ground up that sums numbers as slowly as possible by exploiting memory pitfalls.
-
Perl / Raku
-
Perl ☛ ANNOUNCE: Perl.Wiki V 1.49, etc
The modules are available on MetaCPAN.
-
-
Python
-
Adam Johnson ☛ Python: store extra data for objects in a WeakKeyDictionary - Adam Johnson
A common pattern in Python is to store the data in an extra attribute directly on the object, like module._all_used_names = .... However, this approach has some downsides: [...]
-
-
R / R-Script
-
Rlang ☛ stick function for the EDA in time series
The Exploratory Data Analysis techniques for time series fit the package quite well, although I don’t have many of those yet. So, I’ve implemented the main idea of the STI of Hans Levenbach in a function called “stick” (Seasonal, Trend, Irregular Contribution Kit) in the greybox package for R/Python. The idea is straightforward: apply stick to a time series, it will use ANOVA, and give you the strength of each component. Here, for example, is how to apply the function to the AirPassengers data (everyone’s favourite toy time series) in R: [...]
-
-
Java/Golang
-
Redowan Delowar ☛ Request coalescing with Go singleflight
Say you put a cache in front of Postgres to speed up reads. A hot key expires: [...]
-
Konrad Reiche ☛ Excessive nil pointer checks in Go
Let’s talk about nil pointer checks in Go. You want to prevent panics in production, but that doesn’t start with a deferred recover. It starts with defensive programming. Check your inputs, check your bounds, and check pointers for nil before dereferencing them.
-
Misha Strebkov ☛ Shard your locks: benchmarking 6 Go cache designs | Beyond the Happy Path
I built the same in-memory string → string cache six ways, using nothing but the Go standard library, and benchmarked them under read-heavy, balanced, and write-heavy load across 1 to 8 cores. The rankings flip depending on the workload — and one of the “obvious” answers gets slower the more cores you give it.
TL;DR: Shard your locks. A 256-way striped map (sharded) was the all-around winner — up to 8× faster than a single sync.Mutex at 8 cores — and it’s about 15 lines of code. sync.RWMutex, the reflexive fix for “reads are contended,” is a trap: it barely helps reads past two cores and is slower than a plain mutex for writes.
-