RSSAmplifier

Blog

Davide Angelocola

dfa1.github.ioRSS feed ↗14 posts

Latest posts

RocksDB Performance and Zero-Copy

rocksdbffm, the FFM-based RocksDB binding I wrote about last time. Here's what it took to get reads down to zero allocations — and what the benchmarks had to say about it.

Build the Loop, Not the Prompt

Recently I built three small Java libraries using JDK 25 and the Foreign Function & Memory API: rocksdbffm, vortex-java, and zstd-java. Most of the code was written by an AI agent. The lesson that stuck wasn't about the model: an agent is only as good as the harness around it — a safe language to write in, and a tight loop of tools to catch it when it's wrong.

Earn Your Rules

Once in a while, someone shares an "X rules of software engineering" list and I find myself agreeing with about a third of it. This is my pass through one such list — keeping what I've actually had to write down somewhere, dropping what I haven't, and rewriting the rest in my own language. Each rule opens with an extract from the story where it was earned.

Rethink Domain Primitives with Valhalla

Your Compiler Is Already Part of Your Security Team made the case for domain primitives: encode constraints in types, the compiler enforces them forever. The recurring objection — a wrapper class per int is one heap object per value, plus a pointer to reach it. Fine at the boundary; questionable in a hot loop where allocations and cache misses dominate.

The Cost of Implicitness

You don't pay for implicit assumptions when you write them. You pay when a new joiner interprets them differently, when two teams deploy on different schedules and discover the shared understanding was never shared, when a hotfix swaps two int arguments that meant two different things and the compiler had no opinion. The cost is deferred, invisible, and always larger than expected.

The Slow Fix

This is a success story from when I was working as a consultant in the mid 2010s. This is an extract from notes I took at that time. The inspiration is "The Phoenix Project" — minus the novel format. The goal here is simpler: document what happened, in case it's useful to someone standing at the same starting point.

From BPF to eBPF, Twenty Years Later

In 2004, I wrote a packet sniffer called pangolin. It filtered network traffic using BPF — Berkeley Packet Filter. Raw bytecode. No compiler, no abstraction. Instructions for a virtual machine running inside the Linux kernel, written by hand. Twenty years later, I compiled pangolin on kernel 6.17 on ARM64. One type fix — size_t → socklen_t — and it ran. The bytecode in filters.c was untouched.…

Java + RocksDB - JNI

The best way I know to learn something is to build something real with it. I wanted to understand Java's Foreign Function & Memory (FFM) API properly — not just read the Javadoc, but actually use it. RocksDB was the obvious vehicle: I'm a long-time user of RocksDB and it has a well-defined C API and a problem space I already understood. The result is rocksdbffm: an experimental RocksDB wrapper for…

Coding with Claude Code: A Week on hosh

I've been experimenting with Claude Code on my side project hosh, an experimental shell written in Java. After a few days of pairing with an AI agent on real tasks — adding features, fixing bugs, resolving SonarQube warnings — here's what I found.

The Joy of Proper Encapsulation

Today I pushed a commit to hosh. The commit message was innocent enough: fix: avoid usage of jdk.internal.Signal. The diff was 20 lines added, 31 removed. And it was wrong — not syntactically, but semantically. It changed the behavior of my program in a way I didn't fully appreciate until I sat down and thought about what the Java Platform Module System was actually telling me. This is a story…

Decouple Allocations from Request Volume

Millions of requests per day. RocksDB as the storage engine, returning variable-size values. Nothing about this load profile suggests a performance problem. The implementation has a structural flaw: allocation rate scales with request rate, when it should scale with concurrency.

Make the Implicit Explicit

A Data API with per-request authorization — entitlements delegated to an Entitlement API owned by a separate team. A series of forced decisions — versioned contracts, point-in-time consistency, decorator-based composition — each driven by a different problem. This is a retrospective on a real system.

Your Compiler is already part of your Security Team

It's 3am. Your phone is ringing. A few hours earlier you deployed a hotfix — straightforward change, reviewed in a hurry, went out clean. Now some important data is being published under the wrong market. Instruments from exchange A showing up under exchange B. Clients are seeing it. Someone is already asking if it's a breach. It isn't. It's worse, in a way: the hotfix swapped two arguments. The…

Write Down the Why

Late 2019, early 2020. A newly formed team, building the next generation of a financial reference data platform from scratch. Several developers who never worked together, a greenfield project, a deadline, and two problems we had not yet named: a testing approach that would take us a while to outgrow, and a branching model we had not agreed on yet. Every team has a moment where brute force stops…