Request for Efficiency Suggestions

Request for Efficiency Suggestions

Monday 01 December 2003 7:20:46 am - 2 replies

Author Message

Bruce Morrison

Monday 01 December 2003 2:31:41 pm

Hi Alex

One thing that would help is to move the generation of the table headings to a variable using a {set-block}

e.g.
{set-block variable=tableHead}
<tr class="TableHead">
<th width="100">Steel</th>
<th width="80">{"Carbon"|glossary(true,472,"replace")}<br />(C)</th>
<th width="80">{"Manganese"|glossary(true,472,"replace")}<br />(Mn)</th>
<th width="80">{"Chromium"|glossary(true,472,"replace")}<br />(Cr)</th>
<th width="70">{"Nickel"|glossary(true,472,"replace")}<br />(Ni)</th>
<th width="80">{"Vanadium"|glossary(true,472,"replace")}<br />(V)</th>
<th width="80">{"Molybdenum"|glossary(true,472,"replace")}<br />(Mo)</th>
<th width="80">{"Tungsten"|glossary(true,472,"replace")}<br />(W)</th>
<th width="70">{"Cobalt"|glossary(true,472,"replace")}<br />(Co)</th>
<th width="65">{"Typical Hardness"|glossary(true,472,"replace")}</th>
</tr>
{/set-block}

place this at the top of the template and replace each existing table heading with {$tableHead}

This way all those calls to the glossary operator only happen once instead of twice for each outer loop.

Turn on debugging and have a look at the timing values at the end of the output. You should be able to see where any issues are.

Hope this helps

Cheers
Bruce
http://www.designit.com.au

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Alex Jones

Monday 01 December 2003 2:49:28 pm

Thanks Bruce!

I had actually (re)discovered set-block earlier this afternoon for another area that I am trying to improve, but it hadn't even occured to me to use it there. That is very helpful indeed. :)

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

You must be logged in to post messages in this topic!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.