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 IntrospectorBase.
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, Cheers Henrib -- View this message in context: http://apache-commons.680414.n4.nabble.com/ognl-internal-cache-performance-improvement-tp3576227p3578976.html Sent from the Commons - Dev mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org