commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [ognl] internal cache performance improvement
Date Mon, 06 Jun 2011 14:55:31 GMT
Does concurrency need to be taken into account for the cache? If so, you
need to consider how access to the cache will be synchronized. An intrinsic
lock? A ConcurrentHashMap? and so on.

Gary

On Mon, Jun 6, 2011 at 2:36 AM, Simone Tripodi <simonetripodi@apache.org>wrote:

> Hi all OGNL folks,
> my today's topic is about internal cache, that can be IMHO improved in
> therms of performance; its implementation is a multi-value map alike,
> based on a fixed-size array, a function is applied to each key to
> calculate the array index, each array element is a Collection of
> element.
> Even if getting the list of element related to a general key 'k' has
> complexity of O(1), which is fine, insert/search operations are not
> the best because their complexity is O(m) where m is the size of list
> related to the key.
> Follow below my proposal: there's no need to reinvent the wheel, so
> the array implementation can be replaced with the already provided
> HashMap, where each map value is a simple implementation of balanced
> binary heap (AFAIK commons-collections already provides an
> implementation), that allows us reducing insert/search complexity to
> O(log m).
> WDYT? Is is a worth or trivial added value? I know that maybe cache
> dimension is relatively small, but linear search sounds too basic,
> isn't it?
> Looking forward to your feedbacks, have a nice day,
> Simo
>
> http://people.apache.org/~simonetripodi/
> http://www.99soft.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>


-- 
Thank you,
Gary

http://garygregory.wordpress.com/
http://garygregory.com/
http://people.apache.org/~ggregory/
http://twitter.com/GaryGregory

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