RE: [SMARTY-DEV] Is Smarty using PHP output buffering?

From: Date: Tue, 06 May 2003 18:47:10 +0000
Subject: RE: [SMARTY-DEV] Is Smarty using PHP output buffering?
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1373@lists.php.net to get a copy of this message
Running from the command line, not using OB is definately faster. Through Apache, I don't have a good way to test this easily. (anyone?) If the speed through Apache is going to be faster, I'd vote for that. So, I wouldn't be adverse to the change if it is agreeable. On top of speeding things up, it also covers two other issues: 1) It cleans up Smarty logic a bit. There are two sets of logic in Smarty for buffered and non-buffered content, because you can't conditionally stick OB tags around the same content. Now if we want to make OB configurable, then we're back to square one with this one. 2) It solves the problem of sending HTML headers amidst content already sent. I've run into the problem many times where I want a function (or insert tag within cached content) to send an HTML header, but can't because output already started. Currently the only workaround is to use echo $smarty->fetch(), which is just turning on OB anyways. Monte On Tue, 2003-05-06 at 13:21, luis wrote: > I "sliiiightly" disagree with that. I don't think memory consumption is > an issue, or at least if it happens it is a rare situation in an old > server. > If using output_buffering is faster than not using it then display() > should use output_buffering transparently. > An option to switch outptut buffering can be added for systems with > problems as there is a switch to prevent directory creation for the > templates_c dir. > > > -----Original Message----- > > From: Monte Ohrt [mailto:monte@ispi.net] > > Sent: Tuesday, May 06, 2003 1:21 PM > > To: luis > > Cc: 'Smarty Dev' > > Subject: RE: [SMARTY-DEV] Is Smarty using PHP output buffering? > > > > > > ... and he says right in the slideshow, be careful on low > > memory systems. So it depends on your environment. > > > > If this works well for you, then turn on output_buffering in > > your php.ini. > > > > Monte > > > > > > On Tue, 2003-05-06 at 11:07, luis wrote: > > > Can you try to test if the output of Smarty is faster suing > > > output_buffering? Sterling Hughes mentioned that Output > > buffered pages > > > generally are rendered faster because Apache doesn't have to block > > > between I/O operations. > > > A link to one of the slides: > > > http://talks.php.net/show/hpp/11 > > > > > > Luis. > > > > > > > > > > -----Original Message----- > > > > From: Monte Ohrt [mailto:monte@ispi.net] > > > > Sent: Tuesday, May 06, 2003 12:58 PM > > > > To: luis > > > > Cc: 'Smarty Dev' > > > > Subject: Re: [SMARTY-DEV] Is Smarty using PHP output buffering? > > > > > > > > > > > > Actually Smarty avoids output buffering when it can because > > > > this is viewed as an unnecessary overhead (collecting output > > > > into memory before flushing to the browser.) > > > > > > > > On Tue, 2003-05-06 at 10:32, luis wrote: > > > > > Hi, > > > > > > > > > > Sme benchmarks and studies show that the use of output > > > > buffering even > > > > > when you don't do anything else can improve the time needed > > > > to render > > > > > a page. So a very simple question: Is Smarty using > > > > ob_start(); before > > > > > outputting all the data? > > > > > > > > > > Luis > > > > > > > > > > > > > > -- > > > > 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> > > > > > > -- > > 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 (#1373) next »