Speeding up Huus
This is a short blog covering the changes made to huus to give it a 300-400x speedup. The changes are two-part and simple. These changes seem trivial but often go unnoticed when building a prototype. Before we see these changes let us look at the subpar design decisions that lead to the slow (200-800 ops/sec based on hardware) speeds. 1. Lack of cache and its consequences. The current implementation has no mechanism to hold pages in memory. This results in the system needing to load a page from disk, make changes, and write it back to disk. Even if a page only needs to be read it is loaded into memory, read, and then discarded. Hence we see that for all operations, insertion, updates, reading and deletion, we hit the disk every time while a lot of this can be avoided by caching. ...