From 72cc9c2b6037e881bc67ba1eb105f8949e77c74e Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 28 Jan 2018 01:37:21 -0500 Subject: [PATCH] ExtentWalker: increase efficiency for typical btrfs extent sizes Perf was blaming more than 50% of cycles on TREE_SEARCH_V2. strace showed 4 TREE_SEARCH_V2 calls for every pread in grow_backward(). Fix by increasing the extent fetch batch size so it is more likely to include the desired items in the first fetch attempt. This removes TREE_SEARCH_V2 from the top 10 list of cycle consumers. Signed-off-by: Zygo Blaxell --- include/crucible/extentwalker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crucible/extentwalker.h b/include/crucible/extentwalker.h index 2c1cb0f..b06a1da 100644 --- a/include/crucible/extentwalker.h +++ b/include/crucible/extentwalker.h @@ -58,7 +58,7 @@ namespace crucible { virtual Vec get_extent_map(off_t pos); - static const unsigned sc_extent_fetch_max = 64; + static const unsigned sc_extent_fetch_max = 1024; static const unsigned sc_extent_fetch_min = 4; static const off_t sc_step_size = 0x1000 * (sc_extent_fetch_max / 2);