[xml] Question about xmlDoc->oldNs usage in php
- From: Benjamin Eberlei <kontakt beberlei de>
- To: xml gnome org
- Subject: [xml] Question about xmlDoc->oldNs usage in php
- Date: Mon, 15 Jun 2020 05:04:19 +0200
Hi,
so we identified a performance
bottleneck in PHPs dom implementation when doing a lot of
Element::appendChild calls with namespaced nodes.
PHPs
DOM impl being generic about all kinds of XML use cases, there is a
namespace reconciliation whenever appendChild is called, which calls
xmlReconciliateNs.
But it does some more, it
also iterates the list of namespaces on the node to be added (newNode)
and puts these namespaces into xmlDoc->oldNs. There is a
mistake in php_dom_set_old_ns I believe where namespaces are not deduplicated, essentially
growing the xmlDoc->oldNs list extremely large.
This code is from 2003, and was only shuffled around since then, but its not clear from the commit messages why it exists.
Now
I am wondering what oldNs is even used for here, it seems from the
libxml code it is really only needed to "cache" a pointer to the xmlNs
that represents "xml" and nothing more.
Could someone confirm directly using oldNs is not necessary and can be left for the xmlSearch* functions internally?
greeitngs
Benjamin
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]