ZF-10881: ob_get_contents + ob_get_clean can be done by ob_get_clean

Issue Type: Performance Improvement Created: 2010-12-29T13:15:02.000+0000 Last Updated: 2010-12-30T06:29:00.000+0000 Status: Closed Fix version(s): - 1.11.3 (01/Feb/11)

Reporter: Marc Bennewitz (private) (mabe) Assignee: Marc Bennewitz (private) (mabe) Tags: - Zend_Cache

  • Zend_Config
  • Zend_Debug
  • Zend_Soap_Client

Related issues: Attachments:


found in: library/Zend/Cache/Frontend/Function.php library/Zend/Cache/Frontend/Output.php library/Zend/Soap/Client/Local.php tests/Zend/Cache/ClassFrontendTest.php tests/Zend/Cache/FunctionFrontendTest.php tests/Zend/Cache/OutputFrontendTest.php tests/Zend/Cache/PageFrontendTest.php tests/Zend/ConfigTest.php tests/Zend/DebugTest.php


Posted by Marc Bennewitz (private) (mabe) on 2010-12-29T13:40:21.000+0000

fixed in r23590 (trunk) & r23591 (1.11 branch)

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2010-12-29T13:42:52.000+0000

This issue is marked as performance improvement, but did you do any benchmarks on this issue?

Posted by Marc Bennewitz (private) (mabe) on 2010-12-29T13:58:40.000+0000

from php doc: {quote}ob_get_clean() essentially executes both ob_get_contents() and ob_end_clean().{quote}

this is a simple bench out (runs 1000000):

<pre class="highlight">
ob_get_clean: 0.54880809783936
ob_get_contents + ob_end_clean: 0.63402605056763

-> I know it only a mini difference but the code is a little bit more clean.

<pre class="highlight">
$data = ob_get_contents();
// vs.
$data = ob_get_clean();

Posted by Ramon Henrique Ornelas (ramon) on 2010-12-29T17:14:42.000+0000

Hi @Marc

This issue only will be applied in release 1.11.3 because already was generated the tag 1.11.2 these case should be regenerated the tag or merged changes to tag. Anyway enter in contact with [~matthew].

Greetings Ramon Henrique Ornelas

Posted by Matthew Weier O'Phinney (matthew) on 2010-12-30T05:04:50.000+0000

I'm re-opening so that it doesn't get included in the release changelog, as it was applied after the tag and packages for 1.11.2 were created. I'll close again once the release has occurred.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.