The Need for Speed
The v0.1.3 Core Mission
My Approach to Optimization
- Expanding the Benchmark Suite: I wrote new benchmarks targeting our highest-friction elements (CRDT joins, RGA applies, and Merkle cache routines). I designed scenarios ranging from simple appends (no conflicts) to complex multi-user syncs (many conflicts).
- Profiling for Hotspots: Using flamegraphs, I identified exactly where the CPU was spinning its wheels.
- Targeted Refactoring: I surgically rewrote the identified bottlenecks, ensuring every change was strictly behavior-preserving. Nobody wants a fast database that corrupts data!
1. Turbocharging CRDT Merges
2. Bulletproofing RGA Lists
3. Smarter Caching & Bulletproof Thread Safety
The Results: How Well Did It Work?
🟢 Where MDCS Genuinely Wins
1. Per-Update Network Payload Size
1byte
MDCS
MDCS Avg. Update28bytes
Yjs
Yjs Avg. Update2. Parse Time (Cold Starts)
3. Concurrent Conflict Handling
🔴 Where MDCS Still Loses (The Write Gap)
The Bottom Line
Building a database is hard. Making it fast while keeping its guarantees intact is even harder. But seeing those clean flamegraphs and snappy benchmarks makes all the late-night debugging sessions exactly what I built it for.
If you want to dive deeper into the raw numbers and the architectural changes we made in v0.1.3, check out the resources below:
