Re: performance of parsing docbook with xincludes

Nick Wellnhofer <[email protected]> Fri, 8 Jun 2018 10:49:19 +0200
Newsgroups gmane.comp.gnome.lib.xml.general
Message-ID <[email protected]>
On 08/06/2018 03:45, Eric S. Eberhard wrote:
> Some very simple things to do:  1) put the DTD hosts into the /etc/hosts file 
> (or another if you like and substitute an IP)   2)  set /etc/resolv.conf to 
> first look in the hosts file (before DNS)

The discussion is not about caching DTDs loaded over the network but from the 
local file system. In this particular case, the same Docbook DTD (~250 KB) is 
parsed more than 100 times for each XInclude.

> If I was to suggest a speed up of libxml2 I would change it to allow 
> optionally (probably at compile time) to never free memory -- each node, piece 
> of data, etc that is created and destroyed constantly would just sit there 
> (and slowly grow until it levels out).

libxml2 already allows you to use your own memory allocators. It's easy to 
make `free` a no-op.

Nick