fluo icon indicating copy to clipboard operation
fluo copied to clipboard

Investigate caching String to Bytes conversions and visa versa

Open keith-turner opened this issue 8 years ago • 2 comments

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.

keith-turner avatar Nov 14 '16 15:11 keith-turner

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.

ctubbsii avatar Nov 16 '16 00:11 ctubbsii

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.

keith-turner avatar Nov 17 '16 20:11 keith-turner