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 335559 - xmlXPathRegisterAllFunctions and xmlHashCreate are slow
xmlXPathRegisterAllFunctions and xmlHashCreate are slow
Status: RESOLVED OBSOLETE
Product: libxml2
Classification: Platform
Component: xpath
2.6.22
Other All
: Normal enhancement
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-22 19:38 UTC by Stefan Behnel
Modified: 2021-07-05 13:26 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description Stefan Behnel 2006-03-22 19:38:16 UTC
According to callgrind, the above functions slow down the creation of an XPath
context (xmlXPathNewContext) considerably (allmost 100% of the time spent in
xmlXPathNewContext is eaten by the two, about 50% each). Is it really necessary
to call them? Would it be possible to use pre-built hash tables with all default
XPath functions registered and only copy them in xmlXPathNewContext? That should
really, really speed up context creation.
Comment 1 Daniel Veillard 2006-03-22 20:55:09 UTC
Reuse contexts ! They can be used without limits as long as
it on the same document.
BTW the current version is 2.6.23, 2.4.23 is way too old.

Daniel
Comment 2 Stefan Behnel 2006-03-23 05:37:28 UTC
Sorry, my fault, I meant to file it on 2.6.23 (which is actually missing from the list). Changed it now to 2.6.22 (the highest available).

I can (and do) reuse contexts in some cases (where the document stays the same) but have to build new ones in other cases, e.g. when I want to use a compiled XPath expression on different documents. There, I *could* potentially store a reference to the XPath context with each document, but that would rather be a work-around that somewhat complicates things.

So, what about my suggestion of reusing hash tables internally? Would that make sense?

Stefan
Comment 3 GNOME Infrastructure Team 2021-07-05 13:26:40 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/libxml2/-/issues/

Thank you for your understanding and your help.