Ayende @ Rahien
Read post

Non obvious optimization with divide and conquer

A deep dive into how RavenDB's Corax querying engine optimizes Posting List processing using a divide-and-conquer approach. Instead of a switch statement that branches per item, the new approach uses the lowest 2 bits of each Posting List ID as a bucket index, partitioning items in a branchless single pass. This enables bulk processing: single-value lists can be decoded and sorted with SIMD, while small Posting Lists can be loaded from disk in a single batched call via Container.GetAll(). The result is tighter loops, fewer branches, and more efficient I/O.

    #performance#data-structures#ravendb
Jun 16•5m read time•From ayende.com
Post cover image
9.1K Impressions
Ayende @ Rahien's image
Ayende @ Rahien

Ayende is a software engineer, blogger, and open-source contributor known for his expertise in softw...

44 Followers

•

626 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard