chest
chest copied to clipboard
launch shrink or move_to_disk in separate thread
Much of the cost of using a chest on-disk is writing excess data. If we don't mind possibly spilling over the available_memory limit a bit then this operation could happen asynchronously. Upon inserting a new element in memory we launch a separate thread to call the Chest.shrink function and then release control immediately back to the caller.
Probably the IO here could overlap nicely with computationally intense work.