Re: Memoization
[email protected] Thu, 22 Aug 2002 14:49:28 +0200
| Newsgroups | gmane.comp.gnome.lib.xml.bindings |
|---|---|
| Message-ID | <20020822124928.GA26771@www> |
On Thu, Aug 22, 2002 at 08:13:21AM -0400, Daniel Veillard wrote: > Hum, there is no such mechanism, the only way would be to add an > interface to libxslt to plug-in a document cache. Note that for a single > transformation all the document() result are cached (this is actually > required by the XSLT spec), but there is no mechanism for a more global > cache. Could make sense, could be very small change if one doesn't > try to implement a default cache in libxslt itself. Ah, this is an interesting topic. What could actually be cached? Won't an xml document like the following: <doc> <a>&blub;</a> </doc> resolve to a different result depending on the entity declaration in the importing document? The really imteresting point (IMHO) would be: is it posible to "compact" a parsed XML document (read: xmlDoc) to a memory area of known size so it can be shared be means of shared memory? Ralf > Daniel > > On Thu, Aug 22, 2002 at 12:04:26PM +0100, Gary Benson wrote: > > This is one of those "resending an issue after one week if there was no > > answer might be a good idea" things -- hope you don't mind ;) > > > > -- Gary > > > > On Thu, Aug 08, 2002 at 02:34:07AM +0100, Gary Benson wrote: > > > > > Hiya, > > > > > > I have an application which uses the Python bindings, and I've been > > > looking at ways to speed it up. The profiler shows that about three > > > quarters of the time is spent parsing XML files and there are _a lot_ of > > > repeat parsings going on. > > > > > > Now, it occurred to me that I could speed it up tremendously if I could > > > somehow cache the parsed xmlDocs, but it isn't possible at the Python > > > level since a lot of the repeat parsings are files loaded in the XSLT > > > stylesheets via document(). To be truly effective I'd have to cache > > > them within libxml itself. Ideally, you'd call xmlParsedDocsCache(1) to > > > enable the cache, such that the normal behaviour is unchanged. > > > > > > I'd appreciate some insight from those who know libxml best (so probably > > > Daniel :)). Is what I'm talking about possible, and if it is where > > > would be a nice place to implement it. Obviously I'd like to be able to > > > call xmlParsedDocsCache() from Python code, but how do I make that > > > happen with the automated generator stuff? Libxml is a big bugger and > > > it's hard to know where to start :) > > > > > > Thanks in advance, > > > Gary > > > > > > [ [email protected] ][ GnuPG 85A8F78B ][ http://inauspicious.org/ ] > > > > _______________________________________________ > > xml-bindings mailing list, project page http://xmlsoft.org/ > > [email protected] > > http://mail.gnome.org/mailman/listinfo/xml-bindings > > -- > Daniel Veillard | Red Hat Network https://rhn.redhat.com/ > [email protected] | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ > http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/ > _______________________________________________ > xml-bindings mailing list, project page http://xmlsoft.org/ > [email protected] > http://mail.gnome.org/mailman/listinfo/xml-bindings