Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: The results of the code test.

From: "AndrewF" <andrew@----------------------.--->
To: NULL
Date: 11/10/2006 3:04:00 AM

Hi Sergey, Kevin and Anton,

Thanks to you all for your responses.

Kevin, I had come across the first of those links in my travels but the
others I am going to wade through today and see what can be done.

Sergey - the problem was more writing something to output the XML that
I'm inputting into the XSL transformation rather than anything else as
the transform bit of my code as you rightly say is only a dozen lines
but the XML processing code was several hundred.

I've managed to sort that out though and have used Anton's XsltPerf
tool to run it against a few XML docs using XSL.

What I found was really interesting and we'll forget about Loading
Times of the XSL documents because as I've stated above, I am loading
the doc once into memory and then transforming up to a few thousands
times so that isn't really an issue.

I used Anton's code as my basis of where I put my stopwatch timers so I
was comparing like with like and we are both doing exactly the same
thing starting on one side of the Transorm and stopping on the other.

In my app the average Transform times were [across 50 iterations]:

XT: 20.32ms
XCT: 32.78ms

In Anton's app the average Transform() times were [across 50
iterations]:

XT: 59.48ms
XCT: 40.44ms

I should note that these were run on two different machines however the
only difference between them is processor speed.

Consistently in my app the new transform function is slower than the
old one, though in Anton's app his is consistently faster.

What is very strange is that on the old version of the transform
function the deviation from the mean is minimal. IE when you run this
50 times you get very small changes in the execution time of the
transform function. However with XCT you can get some wildly differrent
results.

Using Anton's tool as it is decimally more accurate and seems to be
good for benchmarking and leaving aside the 1st transformation which
always seems to take longer.

I found that achieving a 40ms average using XCT could give you a lot of
variation from 8ms up to 102ms which equates to 20% of the average time
up to 250% of the average time. Using XT you  would get less variation
- 39ms to 137ms which equates to 65% of the average to 2.3% of the
average.

So it seems to me that XCT can give you a lot more variation in results
than XT which never seems to go that fast in real terms but is more of
a slow and steady candidate overall.

Finally, somethign else I tried to see if it had an effect was to make
Anton's tool use DTDs. The XSL in question actually has some entity
declarations in them and I had to remove them to make it work using
XsltPerf. I then decided to make XsltPerf work using DTDs by adding an
XmlReaderSettings object and loading the XSL that way - which is the
same as I need to do in my app.

Interestingly there was a performance hit on this and it put the
average execution time up from 40.44 ms to 42.67ms across 50 runs.
Extremely interestingly, the variation I indicated earlier disappeared
at this point and we still got a minimum of about 8ms but the max
dropped to 60ms which is a much less erratic way of doing it.

I wonder then if some of the performance hit I'm getting could be borne
out by the fact I'm using XSL Attributes and DTDs? Both of which aren't
present by default in Anton's benhmark app...

Any thoughts gratefully received.

Cheers
AndrewF



transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent