commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitri Plotnikov" <dmi...@apache.org>
Subject Re: [JXPath] Compiled Expressions Cache Impl? (was: Re: JXPath: Thread-Safe Behavior and Real-Time Applications)
Date Tue, 02 Nov 2004 13:35:25 GMT
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" <Emmanouil.Batsis@eurodyn.com>
To: "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
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: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message