On 19-Sep-06, at 12:38 PM, Anthony Gardner wrote:
I've just done a minute test and was shocked at how slow LibXSLT
is comparted to looping rhrough a struct creating the HTML.
I only timed the transform for LibXSLT and the whole reading of
the struct.
timethis( $count, sub { $html = $ss->transform( $lang_doc ) } );
timethis 100000: 37 wallclock secs (11.46 usr + 1.21 sys = 12.67
CPU) @ 7892.66/s (n=100000)
## reading whole struct and doing assigns to $html for the output
timethis 100000: 5 wallclock secs ( 2.13 usr + 0.15 sys = 2.28
CPU) @ 43859.65/s (n=100000)
So, what's the point of LibXSLT when we can roll our own (despite
wanthing to use Perl modules to make our code easier to read)
I'm surprised at the difference but I don't know what's in your XSLT
- that is a huge factor. Are you doing '//' type paths anywhere for
example.
XSLT is a lot more powerful than a simple search/replace templating
solution. Its use also protects you against XSS attacks which I
consider to be a huge bonus that is rarely discussed.
Of course at 8k transforms a second I very much doubt templating is
going to be your bottleneck :-)
Matt.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]