Re: [SMARTY] Smarty 2.6.0 RC1 - Change in path handling
| From: | Wom.bat | Date: | Wed, 13 Aug 2003 15:02:18 +0000 |
| Subject: | Re: [SMARTY] Smarty 2.6.0 RC1 - Change in path handling | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10062@lists.php.net to get a copy of this message | ||
On Wednesday, August 13, 2003 4:50 PM +0200, Mark Rogers wrote:
> David wrote:
>> yeah, that's what I thought about, too... multiple
>> template directories will result in a noticeable
>> performance impact... ;/
[snip]
> I haven't done any benchmarks, but I doubt that the overhead of the
> foreach loop has any impact IF the array being looped through has
> only one value in it. Ie:
>
> $path = '/some/path/';
> if (file_exists($path.'somefile.tpl')) {
> // Do something
> }
>
> .. is unlikely to be any slower (in real terms) than:
>
> $paths = array('/some/path/');
> foreach ($paths as $path) {
> if (file_exists($path.'somefile.tpl')) {
> // Do something
> }
> }
no... of course not... it's the file_exists that makes the difference (there
are dozens of stats done, because php first browses all directories in it's
include path etc etc)
David
[snap]