RavenDB indexing optimizations, Step III–Skipping the disk altogether

time to read 1 min | 180 words

Coming back a bit, before prefetching, we actually had something like this:

image_thumb[1]

 

With the new prefetching, we can parallelize the indexing & the I/O fetching. That is good, but the obvious optimization is actually not going to the disk at all. We already have the documents we want in memory, why no send them directly to the pre fetched queue?

image

As you can see, we didn’t need to even touch the disk to get this working properly. This gives us a really big boost in terms of how fast we can index things. Also note that because we already have those docs in memory, we can still merge separate writes into a single indexing batch, reducing the cost of indexing even further.