Manos,

I recommend that you maintain cache outside JXPath. Use JXPathContext.compile(xpath) to get a compiled expression and store it in your own cache. I think this would be better than exposing the internals of JXPath cache.

Good luck,

- Dmitri

----- Original Message ----- From: "Emmanouil Batsis" <[EMAIL PROTECTED]>
To: "Jakarta Commons Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, November 02, 2004 6:28 AM
Subject: [JXPath] Compiled Expressions Cache Impl? (was: Re: JXPath: Thread-Safe Behavior and Real-Time Applications)




Hi,

Dmitri Plotnikov wrote:

JXPath maintains a global cache of those. Since that cache is of limited size and is shared by all threads, the performance may suffer when all these threads start storing their load of XPaths in that cache. What I would recommend is disabling the automatic caching (for that there is a global variable on JXPathContextImpl) and maintain application's own cache of compiled expressions.


Thanks for the above, *very* informative as I also have thread-safety requirements on XML trees of unknown structure and size. I was thinking of implementing a statistics-and-total-cache-size-based mechanism to figure out frequently used expressions, then store those, but I'm not sure how accessible the JXPath cache is (can i selectively store and remove compiled expressions?), or how easily another cache can be implemented and what that should be like... any suggestions?


Many thanks,

Manos

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to