Without the html stuff, the template looks like ........
 
 <xsl:template match='/config'>
  ...... html type stuff
   <xsl:apply-templates select='languages' />
   ... html type stuff
 </xsl:template>
 
 <xsl:template match='languages'>
    <xsl:apply-templates select='lang' />
  </xsl:template>
 
 <xsl:template match='lang'>
     <xsl:value-of select="@some_attr" />
   <xsl:value-of select="@some_attr" />
   <xsl:value-of select="@some_attr" />
   </xsl:template>
 
 No, the bottle neck will not be to do with this .... I was just surprised at 
the time, that's all.
 
 What with technologies such as ORM, Templating, AxKit  and any others that 
help define MVC (for example) I can;t help think  that at each stage  there's 
always a little bit more overhead.
 
 This doesn't help when I'm trying to find the bottle neck PLUS bring this 
project out of the 18th century and into the new millenium. They could have a 
good case for having a hodge podge of code and keeping it ................. God 
forbid!!

Matt Sergeant <[EMAIL PROTECTED]> wrote: 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.



                
---------------------------------
 All new Yahoo! Mail "The new Interface is stunning in its simplicity and ease 
of use." - PC Magazine

Reply via email to