Dolt is the world’s first version-controlled database aimed as a drop-in replacement for MySQL.
A little over a year ago, Dolt was 12% slower than MySQL on Sysbench, and only capable of 40% of MySQL’s throughput on TPC-C.
Today, we are 25% faster than MySQL on Sysbench, and Dolt has nearly doubled its TPS.
In preparation for the holiday season, this blog will highlight some of the significant performance gains Dolt received.
TL;DR#
Here are some tables and charts summarizing our Sysbench and TPC-C performance over the last year. Spoiler: Dolt is twice as fast as it was a year ago.
| benchmark | v1.59.12 | v2.7.6 | percent_change |
|---|---|---|---|
| covering_index_scan | 3.55 | 2.35 | -33.80 |
| groupby_scan | 211.60 | 66.84 | -68.41 |
| index_join | 2.97 | 2.00 | -32.66 |
| index_join_scan | 1.73 | 1.32 | -23.70 |
| index_scan | 356.70 | 176.73 | -50.45 |
| oltp_point_select | 0.35 | 0.26 | -25.71 |
| oltp_read_only | 7.30 | 5.37 | -26.44 |
| select_random_points | 0.73 | 0.56 | -23.29 |
| select_random_ranges | 1.03 | 0.63 | -38.83 |
| table_scan | 369.77 | 179.94 | -51.34 |
| types_table_scan | 1401.61 | 404.61 | -71.13 |
| overall_reads | -40.52 |

| benchmark | v1.59.12 | v2.7.6 | percent_change |
|---|---|---|---|
| oltp_delete_insert | 9.39 | 4.10 | -56.34 |
| oltp_insert | 4.82 | 2.11 | -56.22 |
| oltp_read_write | 16.12 | 9.73 | -39.64 |
| oltp_update_index | 5.00 | 2.26 | -54.80 |
| oltp_update_non_index | 4.91 | 2.00 | -59.27 |
| oltp_write_only | 9.39 | 4.25 | -54.74 |
| types_delete_insert | 10.27 | 4.57 | -55.50 |
| overall_writes | -53.79 |

| benchmark | v1.59.12 | v2.7.6 | percent_change |
|---|---|---|---|
| tps | 36.00 | 71.61 | 98.92 |

The remainder of this blog reminisces over our most notable performance gains this past year.
Pass-By-Value#
After struggling with a MacOS flamegraph bug, we noticed a large portion of our cpu time was consumed by runetime.duffcopy.
This is the go runtime that copies around data.
It turns out, we were passing our val.TupleDesc and tree.Node structs by value, meaning we were making a copy of the entire struct every time.
Passing pointers to those structs instead gave us up to 20% improvement on Sysbench.
You can read more about this optimization and the MacOS bug in a previous blog.
We uncovered another pass-by-value issue in our nodeCache.
Initially, they were implemented as a Golang array
type nodeCache struct {
stripes [numStripes]*stripe
}
And unlike Golang slices, arrays are copied whenever they are passed around.
Fixing the issue gave us another 13% bump.
You can read more about this optimization (and others) in a previous blog.
Row Serialization#
A surprising amount of CPU time is spent reading and formatting rows to MySQL’s Wire Protocol.
These operations involve a fair bit of string manipulation, and we were able to see improvements by just improving the logic that serializes the rows.
For example, we wrote custom formatting code for DATE, DATETIME and TIME types rather that using Golang’s time library.
More significantly, we decoupled the row iteration logic from the wire formatting logic.
Previously, Dolt had a goroutine that iterated over rows and formatted each one, and another goroutine that batched up rows to send to the client.
Now, Dolt uses a goroutine for row iteration, a goroutine for row serialization, and a goroutine for sending rows to the client.
A better balance among these routines led to over 10% improvement on Sysbench.
Lastly, we invented ValueRow to avoid interface boxing.
Our rows are implemented as a slice of interfaces, because interfaces are easy to deal with.
However, interfaces come with a cost in the form of heap allocations and type assertions.
We noticed that in many cases we could simply avoid the interfaces and write the row as their finalized form in a []byte.
ValueRow alone made types_table_scan 23% faster.
Currently, ValueRow is used in a limited capacity, but we are actively working on this.
Flushing#
These next few optimizations were mainly focused on improving the number of Transactions Per Second (TPS) on our TPC-C benchmarks. Unlike the sysbench metrics, TPC-C measures a more “realistic” mix of reads and writes expected of a production OLTP database.
AutoGC scheduler#
Dolt has a problem with disk footprint due to the amount of garbage we produce.
Our solution is “online” AutoGC, which allows Dolt to clean out this garbage while the server is active, drastically reducing the amount of disk space used.
Unfortunately, AutoGC requires that write to the database be locked, slowing down queries.
To address this, we implement a “nice” AutoGC scheduler that tells AutoGC to wait while the server is under heavy load.
This earned us 10% on TPC-C.
fdatasync#
Without going into too much detail, we discovered that switching from fsync to fdatasync improved sysbench write performance ~30% across the board with +5 TPS.
Unlike fsync, fdatasync only flushes the data and required metadata, minimizing the disk activity required for our write operations.
You can read more about it in here.
Lazy Flush#
Most recently, we implemented what we call “Lazy Flush”, that further increased TPS by 25%.
Lazy Flush defers materialization of table data into RootValues until a transaction is committed, and has readers read from in-memory mutable maps in the meantime.
Conclusion#
Not mentioned are many, smaller, improvements to Dolt we’ve made in the last 400 days or so.
We field-aligned our structs to use less memory, wrote fast-paths for certain queries, leveraged concurrency for GroupBys, etc.
If you’re interested in any of those things, you can read about them in these series of blogs from:
- https://www.dolthub.com/blog/2025-11-07-profiling-on-mac-is-broken/
- https://www.dolthub.com/blog/2025-12-12-how-dolt-got-as-fast-as-mysql/
- https://www.dolthub.com/blog/2026-01-06-more-read-performance-wins/
- https://www.dolthub.com/blog/2026-05-21-12-more-tps/
- https://www.dolthub.com/blog/2026-10-13-overwrites-and-fdatasync-vs-fsync
- https://www.dolthub.com/blog/2026-11-13-lazy-flush/
Dolt has come a long way, and we’re grateful for the progress we’ve made. Going into 2027, Dolt will continue to get faster and better. If you find any performance issues with Dolt, feel free to report it on Github Issues or discuss with a team member on our Discord.