mirror of
https://github.com/Zygo/bees.git
synced 2025-06-17 10:06:16 +02:00
context: add experimental code for avoiding tiny extents
In the current architecture we can't directly measure the physical extent size, and we can't make good decisions with the extent data (reference) item alone. If the early return is enabled here, there is a small speedup and a large drop in dedupe hit rate, especially when extent splits occur. Leave the early return commented for now, but collect the event statistics. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
@ -292,6 +292,15 @@ BeesContext::scan_one_extent(const BeesFileRange &bfr, const Extent &e)
|
||||
BEESTRACE("scan extent " << e);
|
||||
BEESCOUNT(scan_extent);
|
||||
|
||||
// EXPERIMENT: Don't bother with tiny extents unless they are the entire file.
|
||||
// We'll take a tiny extent at BOF or EOF but not in between.
|
||||
if (e.begin() && e.size() < 128 * 1024 && e.end() != Stat(bfr.fd()).st_size) {
|
||||
BEESCOUNT(scan_extent_tiny);
|
||||
// This doesn't work properly with the current architecture,
|
||||
// so we don't do an early return here.
|
||||
// return bfr;
|
||||
}
|
||||
|
||||
// We keep moving this method around
|
||||
auto m_ctx = shared_from_this();
|
||||
|
||||
|
Reference in New Issue
Block a user