
Time is of the essence: EBR in High-Performance Databases
"Can I free you?" When writing high-performance engines that are multi-threaded and highly concurrent, one of the interesting problems to solve is memory reclamation. This is something I had to address when building orrp , a high-performance events/analytics database. The nature of the problem is this: Memory gets allocated for some type of structure. In my case, it's a data structure containing a roaring bitmap , which is an implementation of bitmaps that are highly optimized and great for doing set-based calculations (AND/OR etc). static eval_bitmap_t * _and ( eval_bitmap_t * left , eval_bitmap_t * right , eval_ctx_t * ctx , eng_eval_result_t * result ) { ( void ) result ; if ( left -> own ) { // We own Left, so we can mutate it in-place bitmap_and_inplace ( left -> bm , right -> bm ); return left ; } if ( right -> own ) { // We own Right, so we can mutate it in-place bitmap_and_inplace ( right -> bm , left -> bm ); return right ; } bitmap_t * res_bm = bitmap_and ( left -> bm , right
Continue reading on Dev.to
Opens in a new tab



