Edit report at http://pear.php.net/bugs/bug.php?id=18602&edit=1
ID: 18602
Updated by: [email protected]
Reported By: graylin dot kim at gmail dot com
Summary: Small Optimization for DB_DataObject::fetch()
Status: Open
Type: Feature/Change Request
Package: DB_DataObject
Operating System: WindowsXP
-Package Version: 1.9.5
+Package Version: svn
-PHP Version: 5.2.12
+PHP Version: 5.2.17
Roadmap Versions:
New Comment:
-Package Version: 1.9.5
+Package Version: svn
-PHP Version: 5.2.12
+PHP Version: 5.2.17
Updated the PHP Version and Package Version. Who should be contacted to
have the newer releases of PHP 5.2.x added to the pull down menu? It
stops at 5.2.12 currently.
Previous Comments:
------------------------------------------------------------------------
[2011-06-17 18:15:21] shadesofgraylin
Added #patch
bug:18602;patch:fetch-optimization-str_replace;revision:1308330921;.
------------------------------------------------------------------------
[2011-06-17 17:52:01] shadesofgraylin
Description:
------------
The current fetch implementation calls str_replace twice when once would
be sufficient[1].
Current Implementation[2]:
$kk = str_replace(".", "_", $k);
$kk = str_replace(" ", "_", $kk);
Suggested Implementation:
$kk = str_replace(array("."," "), "_", $k);
With this small fix I experienced gains of 15-20% on fetches.
[1]http://us3.php.net/manual/en/function.str-replace.php
[2]http://svn.php.net/viewvc/pear/packages/DB_DataObject/trunk/DataObject.php?view=markup
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=18602&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.