Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Speed of Template

by chromatic (Archbishop)
on Feb 09, 2001 at 10:18 UTC ( [id://57348]=note: print w/replies, xml ) Need Help??


in reply to Speed of Template

According to the DBI book, fetchrow_hashref() is notably slower than the corresponding array or array_ref functions. Speeding up database access is a good start.

Besides that, though I have seen Template Toolkit slow things down, the TT2 does a compilation/caching stage. In a persistent environment, you'll only pay the penalty of caching templates once, then it's amortized over the rest of the calls to that template. It may not run quite as fast as a heredoc, but it has the potential to do many more complicated things.

If that weren't enough, it's much easier to change a template than it is to change a heredoc. An hour's worth of my time would buy extra memory. A new hard drive if I have to wear a tie.

I would recommend that you use Template for its many benefits, only then worrying about speed. It's not *that* slow, if you do it right. The difference between 5 hits a second and 10 hits a second may not be important when you realize how many hundreds of thousands of hits per day you'll get by that point.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://57348]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-24 22:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found