After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 345561 - Optimization of processing of variables and parameters
Optimization of processing of variables and parameters
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
git master
Other All
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-06-21 15:49 UTC by kbuchcik
Modified: 2021-07-05 11:00 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description kbuchcik 2006-06-21 15:49:17 UTC
We should make the way variables/parameters are acquired
more efficient.
We should eliminate the number of intermediate copies of
the values of variables/parameters.

Currently variables and parameters in XPath expressions are looked
up dynamically during evaluation; the process generates some intermediate
copies of the variable's value.

Example:
<xsl:template match="/">
  <xsl:variable name="var-1" select="'var-value'"/>
  <xsl:value-of select="$var-1"/>
</xsl:template>

The variable is acquired via:

xmlXPathVariableLookup() (xpath.c)
  --> xsltXPathVariableLookup() (libxslt/variables.c)
    --> xsltVariableLookup()
      --> xsltStackLookup()

Later, in xsltVariableLookup(), the XPath object, which is the value
of the variable, is copied with xmlXPathObjectCopy().

Later, in e.g. xsltValueOf(), this object is then converted to a
string object with xmlXPathConvertString(), which creates another
intermediate object (and sorts if a node set); then the string is
aquired via xsltCopyTextString() from the XPath object.

Proposals:

1) Find a way of binding the variables statically to the AST of
   the XPath expression.

2)
  a) Eliminate the copy of the variables value (XPath object).
     This could be done by having flag on the XPath object which
     marks it as immutable. 
  b) Eliminate the intermediate creation of an XPath string object,
     by using xmlXPathCastToString() rather than xmlXPathConvertString().
Comment 1 GNOME Infrastructure Team 2021-07-05 11:00:23 UTC
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.