Re: [SMARTY-DEV] more abstraction committed

From: Date: Fri, 09 May 2003 16:30:47 +0000
Subject: Re: [SMARTY-DEV] more abstraction committed
References: 1 2 3 4 5  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1435@lists.php.net to get a copy of this message
The thinking behind this is that 99.9% of the time you are displaying content. The other .1% you are compiling templates, making cache files, removing/writing files, assembling paths, etc. So, looking at the Smarty.class.php file, a LOT of its functionality (at least half) is for the other .1% which can safely be abstracted. Abstracting these functions _might_ make them a tad slower (I have not benchmarked), but if this makes the template display faster then it is certainly worth the trade-off. We already made a similar effort long ago by abstracting the compiling engine to a separate class file. This is taking that idea a step further and abstracting even more. We might be able to compile templates without creating a new object instance, which would clean up how that is currently done and may be even faster. I like the idea of abstracting functionality into "groups" as opposed to function-by-function and therefore saving some include() calls, that is yet to be tried and tested. Monte On Fri, 2003-05-09 at 10:09, Rémy Dufour wrote: > Great Job Monte ! > I think the ultimate goal behind all of this is to aim at the smallest > Smarty core for displaying a cached page. There is no matter if it take > extra second just to compile or cache the page! > ...Just my 2 cents... > Rémy > > > > The numbers can speak for themselves, the speed is definately faster for > > a non-accelerated invironment, and _still_ slightly faster for > > accelerated. So where these particular things you mention may be > > technically slower (albeit negligible) compared side by side, they are > > more than made up for in other areas as a consequence of the changes. > > > > Of course we won't do something that will cause performance penalties. > > And yes, these concerns were thought about when the changes were made, > > but the changes also BOOST performance, so it is a matter of what one > > outweighs the other to make the overall performance better. > > > > Monte > > > > On Fri, 2003-05-09 at 09:29, Andrei Zmievski wrote: > > > On Fri, 09 May 2003, Monte Ohrt wrote: > > > > On another note, as a consequence of abstracting I also reorganized > the > > > > function arguments to be more like Smarty plugins, so instead of: > > > > > > > > funcname($foo1,$foo2,$foo3) > > > > > > > > we now have: > > > > > > > > funcname($params, &$smarty) > > > > > > > > Where $params is an associative array containing $foo1, $foo2, $foo3. > > > > Thich makes things easier to maintain and expand. > > > > > > Do you realize that the more abstraction levels you add, the slower > > > Smarty becomes? For example, passing parameters in an associative array > > > is definitely slower than passing them explicitly. > > > > > > -Andrei Zç›®'^Nã¸È{ > > > ›½http://www.gravitonic.com/ > > > * Reality isn't all it's cracked up to be. * > > -- > > Monte Ohrt <monte@ispi.net> > > > > > > -- > > Smarty Development Mailing List (http://smarty.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.dev (#1435) next »