Optimizing a three-way merge

8 minutes
Deep inside of the Corax indexing engine inside of RavenDB there is the notion of a posting list. A posting list is just an ordered set of entry ids that contains a particular term. During the indexing process, we need to add and remove items from that posting list. This ends up being something like […]

Not all O(1) operations are considered equal

5 minutes
At some point in any performance optimization sprint, you are going to run into a super annoying problem: The dictionary. The reasoning is quite simple. One of the most powerful optimization techniques is to use a cache, which is usually implemented as a dictionary. Today’s tale is about a dictionary, but surprisingly enough, not about […]

Using RavenDB from Cloudflare Workers

1 minutes
RavenDB is a multi-primary database, which means that it allows you to write to multiple nodes at the same time, without needing synchronization between them. This ability to run independently from the other nodes in the cluster (or even across clusters) makes RavenDB highly suitable for running on the edge. We have recently published a guide […]

A twisted tale of memory optimization

5 minutes
I was looking into reducing the allocation in a particular part of our code, and I ran into what was basically the following code (boiled down to the essentials): As you can see, this does a lot of allocations. The actual method in question was a pretty good size, and all those operations happened in […]

A performance profile mystery: The cost of Stopwatch

6 minutes
Measuring the length of time that a particular piece of code takes is a surprising challenging task. There are two aspects to this, the first is how do you ensure that the cost of getting the start and end times won’t interfere with the work you are doing. The second is how to actually get […]

QCon San Francisco Workshop: Building a database from the ground up

1 minutes
I’m going to QCon San Francisco and will be teaching a full day workshop where we’ll start from a C compiler and  an empty file and end up with a functional storage engine, indexing and more. Included in the minimum requirements are implementing transactions, MVCC, persistent data structures, and indexes. The workshop is going to […]

Struct memory layout optimizations, practical considerations

15 minutes
In my previous post I discussed how we could store the exact same information in several ways, leading to space savings of 66%! That leads to interesting questions with regard to actually making use of this technique in the real world. The reason I posted about this topic is that we just gained a very […]