Re: [PATCH 0/2] strbuf: improve API
- From
David Turner <dturner@twopensource.com>
- Date
- Jun 1, 2016, 19:50 UTC
- Message-ID
- <1464810629.3988.11.camel@twopensource.com>
- In-Reply-To
- <20160601074218.GB14096@sigill.intra.peff.net>
On Wed, 2016-06-01 at 03:42 -0400, Jeff King wrote:
Show 8 quoted lines
> 2. Do caching tricks for strbufs used in tight loops. For example, > have strbuf_release() throw its buffer into a last-used cache, > and > let the next strbuf_grow() use that cache entry. This cuts > malloc() > out of the loop. > > You'd probably want to protect the cache with a mutex, though.
... or make the last-used cache be thread-local.