Re: [PATCH v2 0/5] Allocate cache entries from memory pool
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- May 3, 2018, 16:35 UTC
- Message-ID
- <CACsJy8C3yZ6bSZGw1d5DjwcPgHMDE7iGGUOn9SvyLmshzs9DvQ@mail.gmail.com>
- In-Reply-To
- <20180430153122.243976-1-jamill@microsoft.com>
On Mon, Apr 30, 2018 at 5:31 PM, Jameson Miller <jamill@microsoft.com> wrote:
Show 7 quoted lines
> This patch series improves the performance of loading indexes by > reducing the number of malloc() calls. Loading the index from disk is > partly dominated by the time in malloc(), which is called for each > index entry. This patch series reduces the number of times malloc() is > called as part of loading the index, and instead allocates a block of > memory upfront that is large enough to hold all of the cache entries, > and chunks this memory itself. This change builds on [1].
I have only looked at the mem-pool related patches to see if mem-pool.c is good enough to replace alloc.c. To me, it's a "yes" after we optimize mem_pool_alloc() a bit (not that performance really matters in alloc.c case, but that may be because it's already blazingly fast that we never noticed about it).
I probably should look at read-cache.c changes too. Maybe later. Although after the change to use xmalloc() per entry a few years(?) ago, it should be straight forward to use a different memory allocator.
-- Duy