RE: [SMARTY] include() performance
| From: | Bob Silva | Date: | Thu, 24 Oct 2002 17:14:46 +0000 |
| Subject: | RE: [SMARTY] include() performance | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-6232@lists.php.net to get a copy of this message | ||
I sent a patch to the list a few months ago that showed how to include
files inline.
http://marc.theaimsgroup.com/?l=smarty-dev&m=102739310908449&w=2
Works like a charm, just add inline="true" to your include tag...
{include file="core_header.tpl" inline="true"}
This causes the included file to be compiled into the compiled template
instead of being dynamically included at run-time.
Hope this helps.
Bob Silva
-----Original Message-----
From: Sujal Shah [mailto:sujal@sujal.net]
Sent: Thursday, October 24, 2002 9:32 AM
To: smarty-general@lists.php.net
Subject: Re: [SMARTY] include() performance
Doesn't that make sense...? I mean, include has to open up a file, snarf
it up, and then close it. Over and over and over and over......
I'm new to smarty, so I'm not sure if the template compiler inlines the
include call, so maybe that could be an optimization, but aside from
that, I would expect that to be slower.
sujal
On Thu, 2002-10-24 at 12:10, Ulf Wendel wrote:
> Hi,
>
> while I was looking at my application to find out why it's so "slow" I
> noticed that smarty caused quite some delays. I figured out that that
my
> massive use of smarty's include function caused the delays. Due to a
> loop I was using upto ~200 includes per page.
>
> However, replacing the include function with the content of the
included
> file was really a good idea:
>
> time per loop
>
> include: 0.3630 s
> without: 0.0133 s => ~ 27 x faster
>
> (the figure shows typical times for the first of up to 19 loops per
page)
>
> How about adding a note to the docs?
>
> Ulf
>
> --
> WWE e-commerce IT GmbH, http://wwe.biz
> Eiffestrasse 462, D-20537 Hamburg
> Tel: 040 / 25 30 65 9-0, Fax: 040 / 25 30 65 950
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
---- Sujal Shah --- sujal@sujal.net ---
http://www.sujal.net
Now Playing: none
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php