Re: Smaller Size?
| From: | Andrei Zmievski | Date: | Wed, 23 Jan 2002 19:41:38 +0000 |
| Subject: | Re: Smaller Size? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2571@lists.php.net to get a copy of this message | ||
On Wed, 23 Jan 2002, Brian E. Lozier wrote:
> It seems like you could do the same with other functions as you have with
> the compiler class - make different classes for the config, caching, etc.,
> all included only if they're needed for a specific page.
>
> Like, I never use config files, or these strange function things you have
> written in all over the place (to allow people to add their own functions,
> maybe?), or these 'addins,' debugging, or any other strange functions.
>
> I don't use anything (unless it's called internally) from the custom_funcs
> or the custom_mods.
>
> It seems like Smarty is touted as being all fast, which is probably true,
> but it could be faster if it didn't load so much in the class itself.
>
> if($this->caching) {
> // include class.smarty.cache.php
> }
> if($this->debug) {
> // include class.smarty.debug.php
> }
It's not quite that simple. The debugging code, for example, is
intertwined with the rest in a lot of places. Not saying that this is
not possible to do, just not trivial.
> It just seems like 1500 lines for the base class, and over 800 for the
> addins class, all loaded each and every time a smarty page is called, seems
> a bit excessive. Especially if the template is already cached/compiled and
> you don't need any of the other stuff that's included with the class.
The addons could probably be included only when not displaying cached
page. That should save some parsing time.
-Andrei
"This isn't right. This isn't even wrong."
-- Wolfgang Pauli