GNOME Bugzilla – Bug 342695
Optimization of copying of attributes in xsltCopyProp()
Last modified: 2021-07-05 10:59:42 UTC
In xsltCopyProp() (transform.c) the value of an attribute is copied by the use of standard Libxml2 functions. However I think we could optimize this. The value string of the attribute is obtained using xmlNodeListGetString(), then the value is set (together with the attribute node) with xmlSetNsProp(). xmlSetNsProp() will perform an entity-encoding with xmlEncodeEntitiesReentrant() and then generate the text/entity-ref nodes by applying xmlStringGetNodeList(). I think the encoding and text/entity-ref generation step could be skipped, since the value string obtained by xmlNodeListGetString() is: 1) freshly allocated memory 1) an UTF-8 encoded string 2) entities are substituted I think we can just create a text node on the resulting attribute node and attach the value string to it. I would be glad if someone could verify this assumptions.
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a new ticket at https://gitlab.gnome.org/GNOME/libxslt/-/issues/ Thank you for your understanding and your help.