Re: [xml] Thread safety



On Thu, Jul 03, 2003 at 08:57:40AM -0700, Jerome Pesenti wrote:
Turning on thread safety in libxml seems to have a big
perfomance cost when doing XSL transformations.

Here is a typical example:

22ms Using libxml 20507 (--without-threads), libxslt
10030 and libexslt 719
37ms Using libxml 20507 (--with-threads, libxslt 10030
and libexslt 719
30ms Using libxml 20430, libxslt 10024 and libexslt
715

That is a 70% increase in running time (note the nice
30% improvement between 2.4.30/1.2.4 and 2.5.7/1.3.0)
which I can consistenly reproduce with different
XML/XSL.

Is there any way to go around this?

  make sure your memory allocator for threaded and non-threaded
operations is as fast. If you're on linux and using a not very recent
(i.e. something like RH9 with NPTL) then you're hitting the old
-lpthread memory allocator which had the kind of perf problem you
report. You don't report your OS setup but I suspect you have a not
very recent Linux setup ...

Other question: is --with-threads required for 
thread safety when running different transformations
with different XML and XSL and the same global
options?

  probably not but --with-threads introduce a level of
confidence I don't have without it. It may depend how your
application is coded...

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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