[xslt] xml/xst timings reported by xsltproc.



I am one of the developers working on mod-xslt project (apache module
that does XSL transformations on the web server using libxml/libxslt
libraries). While trying to add some optimizations to the apache module
I noticed some rather interesting differences in numbers. I was using
"xsltproc --timing --profile --noout" for aproximate timing values in
order to see how much a certain step during the
parsing/transformation/saving could impact performance. Another tool
that I use for benchmarking performance is "ab" (comes with apache). One
of the latest things was me adding a caching mechanism for parsed XML
and XSL files. (Saving and reusing pointers)

Before I show the numbers here is the version of xsltproc that I am using:
Using libxml 20503, libxslt 10026 and libexslt 717
xsltproc was compiled against libxml 20503, libxslt 10026 and libexslt 717
libxslt 10026 was compiled against libxml 20503
libexslt 717 was compiled against libxml 20503

I am compiling my module against "libxml2-2.5.3-1" and "libxslt-1.0.26-1". 

This is the my xml file:
 59834 Feb 24 14:40 nstate.xml

xsltproc from command-line gives me:
[clipped]
Parsing document nstate.xml took 13 ms
[clipped]

here is what I am seeing with "ab -n 50":
[clipped]

Concurrency Level:      1
Time taken for tests:   5.869999 seconds
Complete requests:      50
Failed requests:        0
Write errors:           0
Total transferred:      3613200 bytes
HTML transferred:       3598650 bytes
Requests per second:    8.52 [#/sec] (mean)
Time per request:       117.400 [ms] (mean)
Time per request:       117.400 [ms] (mean, across all concurrent requests)
Transfer rate:          601.02 [Kbytes/sec] received

Connection Times (ms)
             min  mean[+/-sd] median   max
Connect:        0    0   0.0      0       0
Processing:   114  116   8.1    114     141
Waiting:      113  115   8.1    113     140
Total:        114  116   8.1    114     141

Percentage of the requests served within a certain time (ms)
 50%    114
 66%    114
 75%    115
 80%    115
 90%    140
 95%    141
 98%    141
 99%    141
100%    141 (longest request)

Just to show the difference in the numbers. it seems that by caching
parsed XML references we are winning ~27ms. And the fluctuations are
when each process reloads the updated copy of the XML file. So some of
the requests use a cached copy (114ms) vs parsing (141ms). For me the
curious thing is why am I seeing such a big difference between what
xsltproc says and what I am getting from ab.

P.S. On another note, here is a quick question. I have switched the code
in the development version to stay away from using OutputBuffer and it's
callbacks and use xsltSaveResultToString() instead. This appears to be
aprox 2-3ms performance win since we generate everything in one big
chunk vs allocating and using callbacks for small bunches of output. The
real question is how efficient is the code for xsltSaveResultToString()
and does it use realloc() or does a quick precompute pass to calculate
the size of the buffer to allocate for the output? And is there a better
way of doing this?

P.S.S. mod-xslt can be found at http://sourceforge.net/projects/mod-xslt/
(all of the development code is in CVS specifically
mod-xslt/src/mod-xslt.c file)

G.F. aka Gena01
http://www.gena01.com



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