johnzon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <>
Subject Re: Main purpose of BufferCache<T>
Date Fri, 27 Jun 2014 15:09:01 GMT

there are 2 BufferCache usage. Basically we cache *allocations* (not
values) of StringBuilder and char[] (parser buffer). Name is maybe not the
best one, BufferRecycle can be better. Fleece factories are thread safe,
(then parser, generator etc are not).

It really changes the performances but a better implementation (with no
dependency) would work.

Any proposal?

Romain Manni-Bucau
Twitter: @rmannibucau

2014-06-27 16:22 GMT+02:00 Hendrik Dev <>:

> Hello,
> what is the main purpose of org.apache.fleece.core.BufferCache<T>?
> Is it to be a real thread local cache (because we excpect that we have
> many parallel threads running) or just a cache which use threadlocals
> as a kind of an internal implementation (not expecting really parallel
> threads)?
> The comment within this class is
> "// alloc are expensive so using a very trivial buffer, we remove from
> TL to say we use it and reset it when we are done (close)"
> Which allocations are meant?  StringBuilder, char[], <T>, ...
> Is fleece supposed to be a threadsafe library? (Beyond wahts marked to
> be thread-safe in the apispecs)
> Thanks
> Hendrik (salyh)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message