From ec9d4a1d15df95fc7da36f2813486025d0eada6b Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Sun, 11 Dec 2016 13:21:52 -0500 Subject: [PATCH] crucible: fs: use a much smaller default search buffer size It turns out we never use a value for m_buf_size that isn't the default, and we also never ask for more than a few thousand items; however, we do spend a ton of time memsetting the huge buffer to zero. I don't know what the ideal size is, but 16K is a far better guess than 1MB. Let's reduce it for some immediate CPU benefit, and determine what the size should be later. Reported at https://github.com/Zygo/bees/issues/11 --- include/crucible/fs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/crucible/fs.h b/include/crucible/fs.h index 8d93de4..73defe4 100644 --- a/include/crucible/fs.h +++ b/include/crucible/fs.h @@ -156,7 +156,7 @@ namespace crucible { ostream & operator<<(ostream &os, const BtrfsIoctlSearchHeader &hdr); struct BtrfsIoctlSearchKey : public btrfs_ioctl_search_key { - BtrfsIoctlSearchKey(size_t buf_size = 1024 * 1024); + BtrfsIoctlSearchKey(size_t buf_size = 16 * 1024); virtual bool do_ioctl_nothrow(int fd); virtual void do_ioctl(int fd);