mirror of
https://github.com/Zygo/bees.git
synced 2025-05-17 21:35:45 +02:00
Binary searches can be extremely slow if the target bytenr is near a metadata block group, because metadata items are not visible to the binary search algorithm. In a non-mixed-bg filesystem, there can be hundreds of thousands of metadata items between data extent items, and since the binary search algorithm can't see them, it will run searches that iterate over hundreds of thousands of objects about a dozen times. This is less of a problem for mixed-bg filesystems because the data and metadata blocks are not isolated from each other. The binary search algorithm still can't see the metadata items, but there are usually some data items close by to prevent the linear item filter from running too long. Introduce a new fetcher class (all the good names were taken) that tracks where the end of the current block group is. When the end of the current block group is reached in the linear search, skip ahead to a block group that can contain data items. Signed-off-by: Zygo Blaxell <bees@furryterror.org>