<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   >
<channel>
    
    <title>iBlog - Ilia Alshanetsky - Comments</title>
    <link>http://ilia.ws/</link>
    <description>iBlog - Ilia Alshanetsky - Here be dragons.</description>
    <dc:language>en</dc:language>
    <admin:errorReportsTo rdf:resource="mailto:" />
    <generator>Serendipity 1.5.5 - http://www.s9y.org/</generator>
    
    <image>
        <url>http://ilia.ws/templates/default/img/s9y_banner_small.png</url>
        <title>RSS: iBlog - Ilia Alshanetsky - Comments - iBlog - Ilia Alshanetsky - Here be dragons.</title>
        <link>http://ilia.ws/</link>
        <width>100</width>
        <height>21</height>
    </image>

<item>
    <title>Mike: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202502</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Mike)</author>
    <content:encoded>
    How about a PHP_OUTPUT_HANDLER_ABSORBENT flag for trunk?&lt;br /&gt;
&lt;br /&gt;
ob_start(null, 1024, PHP_OUTPUT_HANDLER_STDFLAGS | PHP_OUTPUT_HANDLER_ABSORBENT);&lt;br /&gt;
&lt;br /&gt;
Though, due to current implementation, PHP_OUTPUT_HANDLER_ALIGN_TO_SIZE, i.e. 4k, is the allocation barrier. 
    </content:encoded>

    <pubDate>Mon, 12 Dec 2011 05:12:28 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202502</guid>
    
</item>
<item>
    <title>gphilip: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202500</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (gphilip)</author>
    <content:encoded>
    Hi,&lt;br /&gt;
&lt;br /&gt;
&quot;What was unusual is that 16 calls to ob_start() up chewing through almost 700kb of memory&quot;&lt;br /&gt;
&lt;br /&gt;
Can you give more information please under what circumstances it happened?&lt;br /&gt;
&lt;br /&gt;
http://pastebin.com/XPhtzpAh&lt;br /&gt;
&lt;br /&gt;
I think ob_get_clean takes care of freeing the memory right away, so an ob_call in one request can result in max 40kB &quot;extra peak&quot;, which is nothing in case of a regular webapplication. 
    </content:encoded>

    <pubDate>Mon, 12 Dec 2011 03:56:48 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202500</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202444</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    In PHP 5.4 the default buffer size was reduced to 0x4000 (16kb), which in part is responsible for the performance improvement. &lt;br /&gt;
&lt;br /&gt;
5.4 still suffers from the limitation that you cannot specify a custom buffer size, and have it be automatically increased when the data in the buffer exceeds the buffer size. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 11:49:06 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202444</guid>
    
</item>
<item>
    <title>Chris Jones: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202443</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Chris Jones)</author>
    <content:encoded>
    An error is thrown in PHP 5.4 but not PHP 5.3:&lt;br /&gt;
&lt;br /&gt;
$ cat t.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ php54 t.php&lt;br /&gt;
PHP Warning:  ob_start(): no array or string given in /tmp/t.php on line 3&lt;br /&gt;
&lt;br /&gt;
Ilia&#039;s patch to PHP 5.3 allowed the first parameter to be overloaded. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 10:00:19 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202443</guid>
    
</item>
<item>
    <title>Chris Jones: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202442</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Chris Jones)</author>
    <content:encoded>
    For people not following PHP development, output buffering changed a lot in PHP 5.4. Running this:&lt;br /&gt;
&lt;br /&gt;
$a = microtime(1);&lt;br /&gt;
for ($i = 0; $i &lt; 100000; $i++) {&lt;br /&gt;
    ob_start();&lt;br /&gt;
    echo str_repeat(&quot;a&quot;, 1024);&lt;br /&gt;
    ob_end_clean();&lt;br /&gt;
}&lt;br /&gt;
var_dump(microtime(1) - $a);&lt;br /&gt;
echo memory_get_peak_usage(true), &quot;\n&quot;;&lt;br /&gt;
&lt;br /&gt;
against an unpatched PHP 5.3 and PHP 5.4 gives:&lt;br /&gt;
&lt;br /&gt;
$ php53 test.php &lt;br /&gt;
float(0.66586494445801)&lt;br /&gt;
524288&lt;br /&gt;
$ php54 test.php &lt;br /&gt;
float(0.29983496665955)&lt;br /&gt;
262144 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 09:55:39 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202442</guid>
    
</item>
<item>
    <title>Sebastian: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202437</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Sebastian)</author>
    <content:encoded>
    I dont understand your post because the first parameter for ob_start is not the chunk size, it is the callback function. It seems to be that ob_start doest not throw a error if callback is not valid.&lt;br /&gt;
&lt;br /&gt;
Example: ob_start(&#039;asdf&#039;); (function not av.) 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 06:04:14 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202437</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202435</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    You can try the test at:&lt;br /&gt;
http://pastebin.com/Kjpmea3h&lt;br /&gt;
&lt;br /&gt;
in this test the new code is about 25% faster, not to mention more memory efficient. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 05:21:10 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202435</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202433</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    Think of a templating system that needs to generate various sub-templates and place resulting data in various different sections of the page. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 04:19:23 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202433</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202432</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    There is a really good reason why it is slower. Your text is quite big, but you set your initial buffer size to mere 1kb, so PHP needs to keep resizing the buffer resulting in a slow down due to memory re-allocation. If you set the initial to a size more reflective of your output size you will see a performance benefit.&lt;br /&gt;
&lt;br /&gt;
As it stands you have a text size that is 3.2kb in size that you display 50 times for a total of 150+kb. With default allocation schema there are 12 re-allocations, with 1kb buffer there are 150 (10x more), hence the speed drop. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 04:10:57 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202432</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202431</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    You are correct, it should say 10kb not 20... I&#039;ll adjust. 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 04:05:30 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202431</guid>
    
</item>
<item>
    <title>Sebastian: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202428</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Sebastian)</author>
    <content:encoded>
    Hi! i&#039;ve tested this with a little script: http://pastebin.com/w27a5MXP&lt;br /&gt;
&lt;br /&gt;
Seems that the execution time increase if you set the chunk size. &lt;br /&gt;
&lt;br /&gt;
Tests&lt;br /&gt;
- without chunk size ~0.1 ms&lt;br /&gt;
- with chunk size ~2.0 ms&lt;br /&gt;
&lt;br /&gt;
But test it your self &lt;img src=&quot;http://ilia.ws/templates/default/img/emoticons/wink.png&quot; alt=&quot;;-)&quot; style=&quot;display: inline; vertical-align: bottom;&quot; class=&quot;emoticon&quot; /&gt; 
    </content:encoded>

    <pubDate>Thu, 08 Dec 2011 02:20:44 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202428</guid>
    
</item>
<item>
    <title>Evan: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202425</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Evan)</author>
    <content:encoded>
    Co solution but what is he use-case for using ob so extensively? 
    </content:encoded>

    <pubDate>Wed, 07 Dec 2011 19:50:38 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202425</guid>
    
</item>
<item>
    <title>Sam Hennessy: PHP's Output Buffering</title>
    <link>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#c202423</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/244-PHPs-Output-Buffering.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=244</wfw:comment>

    

    <author>nospam@example.com (Sam Hennessy)</author>
    <content:encoded>
    Thanks for the post! Maybe I&#039;m reading it wrong, but the snippet for the block size says 10*1024, but in the body of the post you say the block size is 20 kb. 
    </content:encoded>

    <pubDate>Wed, 07 Dec 2011 19:08:23 -0500</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/244-guid.html#c202423</guid>
    
</item>
<item>
    <title>filipina heart: &quot;Under the Hood&quot; Slides</title>
    <link>http://ilia.ws/archives/243-Under-the-Hood-Slides.html#c201487</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/243-Under-the-Hood-Slides.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=243</wfw:comment>

    

    <author>nospam@example.com (filipina heart)</author>
    <content:encoded>
    How does the bookstore riot within Usein kysytyt kysymykset (TS3) | Edit 19.7.11? A handy outlook destines the power beneath the batch. The accusing intercourse parallels the retrieval. When will the whale enter before the dense tea? Why won&#039;t the electronics announce Usein kysytyt kysymykset (TS3) | Edit 19.7.11? 
    </content:encoded>

    <pubDate>Sun, 30 Oct 2011 01:41:34 -0400</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/243-guid.html#c201487</guid>
    
</item>
<item>
    <title>Ilia Alshanetsky: New PHP-Excel (0.9.5) was just released! </title>
    <link>http://ilia.ws/archives/242-New-PHP-Excel-0.9.5-was-just-released!.html#c201069</link>
            <category></category>
    
    <comments>http://ilia.ws/archives/242-New-PHP-Excel-0.9.5-was-just-released!.html#comments</comments>
    <wfw:comment>http://ilia.ws/wfwcomment.php?cid=242</wfw:comment>

    

    <author>nospam@example.com (Ilia Alshanetsky)</author>
    <content:encoded>
    From what I can tell in the discussion, the errors are based on library and/or headers not being in the path. 
    </content:encoded>

    <pubDate>Fri, 07 Oct 2011 14:00:12 -0400</pubDate>
    <guid isPermaLink="false">http://ilia.ws/archives/242-guid.html#c201069</guid>
    
</item>

</channel>
</rss>
