[infinispan-dev] Improved Marshaller

Manik Surtani manik at jboss.org
Wed May 20 07:53:24 EDT 2009


On 19 May 2009, at 18:00, Galder Zamarreno wrote:

> Manik Surtani wrote:
>> I just checked the following in trunk.
>> Galder, you may want to do something similar for your JBMAR  
>> prototype.
>> The changes are around InternalCacheEntry and now InternalCacheValue.
>> Previously, the marshaller stored an InternalCacheEntry as [key,  
>> value, canExpire, created, lifespan, lastUsed, maxIdle], setting  
>> either of the last 4 elements to -1 if they are unused.  In a  
>> system mainly comprising of mortal values, this is wasteful since  
>> each of the last 2 values - which would be unused - are longs and  
>> still written to.
>> So this change identifies the InternalCacheEntry and writes just  
>> what is needed, hence the use of specific magic numbers for each of  
>> the InternalCacheEntry implementations.  Using a different magic  
>> number for each entry type allows me to trim what is written.
>> Same approach used for InternalCacheValue.
>> Yes, even more ugly switch statements - and this is why we need  
>> JBMAR to clean this up - if and when it can match performance and  
>> compactness of the resulting byte array.  :-)
>
> This has been done now.

Thanks!
--
Manik Surtani
manik at jboss.org
Lead, Infinispan
Lead, JBoss Cache
http://www.infinispan.org
http://www.jbosscache.org







More information about the infinispan-dev mailing list