Re: [xml] performance of parsing docbook with xincludes



On 14/05/2018 21:48, Stefan Sauer wrote:
This part looks suspicious:

                |--22.98%--0xc2160
                |          xmlFreeDoc
                |          |
                |           --22.42%--xmlFreeDtd

Can I tell it to not load dtds in the first place? Is it loading the dtd for each an every xinclude?

Good catch. It seems that the XInclude engine always parses included docs with XML_PARSE_DTDLOAD:

    https://git.gnome.org/browse/libxml2/tree/xinclude.c#n450

If you're not using XML catalogs, this will probably cause the DTD to be loaded over the network multiple times which could explain the slowdown.

Can you try to change the line to

    xmlCtxtUseOptions(pctxt, ctxt->parseFlags);

and see if it helps?

Nick


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]