fluo
fluo copied to clipboard
Investigate caching String to Bytes conversions and visa versa
Since String and Bytes are both immutable, it may be worthwhile to cache conversion from one to the other. The following are some thoughts on possible implementations.
- Per thread cache w/o synchronization
- Global cache with synchronization
- Hybrid per thread/global cache
- Single threaded short lived per operation/per transaction caches.
Accumulo's client code has suffered from excessive caching of objects globally/statically in the JVM, all outside the user's control. If a caching feature is introduced, the user should have control over the size and lifecycle of the cache, to learn from Accumulo's lessons.
Of the options, I think the short-lived cache is most appealing. But, if it's user-provided, they could selectively re-use the same cache for many operations.
In #804 I did some very narrow caching. This caching is only at a per transaction level and in some cases only per a transactions operation.