• New Feature
  • Status: Resolved
  • 2 Major
  • Resolution: Won't Fix
  • interfaces
  • Reporter: teck
  • March 26, 2009
  • 0
  • Watchers: 1
  • February 12, 2014
  • February 12, 2014

Description

If a user is pushing instance of byte[] into a tccache, we’ll end up serializing it (to another byte[]). Although we shouldn’t just take the byte[] raw from the application, it would probably be faster and create less garbage to either clone() or use System.arraycopy to “serialize” it in on put() (same thing for get())

Comments

Steve Harris 2009-03-27

I wonder if we should have an immutable put of some sort where we could avoid the copy completely

Steve Harris 2009-03-30

If one puts a byte array and it is immutable, knowing that means we don’t have to copy it. If we don’t know that the bytearray is immutable we do have to copy it.

Tim Eck 2009-03-30

So the suggestion here is that there is a specific method (eg. putImmutable()) that an application can use to express that the value will not be mutated (an array is always mutable).

I think this suggestion could fall under the category of configuring the cache instance as a whole to not copy on put() and/or get(). It is less safe but could be a way for people to get performance as a tradeoff.

Alex Miller 2009-03-30

+1 to that - I think it should be a config option. would be nice to just set up caches containing pre-serialized object byte[] and completely avoid the copy or need for special methods.

Alex Miller 2009-05-14

moving to pending - will not do in Rivera

Hung Huynh 2014-02-12

DSO is discontinued