Re: [SMARTY-DEV] Inlining plugins/modifiers

From: Date: Thu, 22 May 2003 19:47:39 +0000
Subject: Re: [SMARTY-DEV] Inlining plugins/modifiers
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1496@lists.php.net to get a copy of this message
http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.3 Most of the points mentioned there apply to this situation as well. On Thu, 22 May 2003, boots wrote: > I think there is another point that is being missed that makes inlining > attractive. Yes, include_once helps as does an accelerator. Andrei's > comment is misleading, though: why should performance decrease? Because > inlining will cause certain portions of the page to be re-compiled by > PHP while they would otherwise just be looked up? > > Consider the case where you have a compiled template that does not need > to do ANY further plugin loads, etc. The filesystem is one of the > slowest subsystems in the computer so minimizing ANY indirect calls to > it is a Very Good Thing, especially if the calls were consolidated into > a single pass at compile time. When a client includes this compiled > file the only "lookups" are for the file itself, which, though longer, > if sitting in an accelerator's cache, will be delivered very quickly. > No hash lookups at all. It is disingenious to say it is slower to > inline "period": it doesn't take even a million hits to see that there > is a POTENTIAL savings here. > > On the other hand, its tricky business because there are many details > to consider, especially in a caching system. Also, it makes plugins > more like snippet libraries. Never-the-less, I think inlining merits > consideration though I don't think it should be an on-or-off switch. -Andrei

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