Re: [SMARTY-DEV] Re: Recent checking bad for performance
| From: | Monte Ohrt | Date: | Wed, 07 May 2003 19:08:01 +0000 |
| Subject: | Re: [SMARTY-DEV] Re: Recent checking bad for performance | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1417@lists.php.net to get a copy of this message | ||
Good!
I just committed (and changed) a couple more things. It is basically an
idea to abstract some of the core functionality from the main class.
Here's the thinking behind it:
For a preliminary test, I abstracted two functions: the
_display_debug_console() (which was renamed from
_generate_debug_output()) and _assign_smarty_interface() functions.
These are now in the plugin directory under the names:
core.display_debug_console.php
core.assign_smarty_interface.php
This abstraction adds an include() and function call, but it will also
consolidate many functions in Smarty.class.php into one function:
_execute_core_function(). I'll have to do some benchmarks and see if
this has a performance impact... it might be slight or hopefully next to
nothing. Even so, we can at least safely abstract all the functionality
that is done at compile time, and possibly some things that are
lesser-used (like assign_smarty_interface.) All in all, it will lean up
the size of Smarty.class.php and allow core functions to be replaced
easily if desired.
I also thought about using class(es) and calling methods statically, but
a raw function call should be quicker (AFAIK?)
BE SURE to remove compiled templates and update ALL files in the smarty
libarary including plugins, func names have changed!
Monte
On Wed, 2003-05-07 at 13:34, Tom Sommer wrote:
> On 07 May 2003 13:27:52 -0500, Monte Ohrt wrote:
>
> > Does this problem happen when executing the demo that comes in CVS?
>
> Found the problem, it appears that my CVS update found conflicts when
> updating Smarty.class.php (I had modified it to show compile times for
> fetch()), and so was not able to update correctly...
>
> Problem solved :)
>
> --
> Tom Sommer, Denmark
> www.tsn.dk - www.dreamcoder.dk
--
Monte Ohrt <monte@ispi.net>