commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henrib <>
Subject Re: [ognl] internal cache performance improvement
Date Tue, 07 Jun 2011 08:43:10 GMT
Hi Simo;
You might want to take a look at jexl in the
org.apache.commons.jexl2.internal.introspection and
org.apache.commons.jexl2.internal packages for ideas, more specifically at

Jexl caching is roughly a hashmap keyed by classes whose values are
(essentially) hashmap keyed on method signatures pointing to methods. Cache
access is synchronized and the whole cache is soft-refed so it can be
evicted on memory pressure (or class loader change).
To further reduce contention, the jexl interpreter caches method references
in AST nodes through a volatile member; after the first execution, the
script/statement retries to call the cached method. It will only go back to
the class cache if the call is unsuccessful.

At a higher level but I'm not sure it is practical, the
org.apache.commons.jexl2.introspection package could be (re)used; it
abstracts the whole introspection parts caching included.

Hope this can help,

View this message in context:
Sent from the Commons - Dev mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message