ID:               50486
 Updated by:       basa...@php.net
 Reported By:      basant dot kukreja at gmail dot com
 Status:           Open
 Bug Type:         Performance problem
 Operating System: Solaris 10
 PHP Version:      5.3SVN-2009-12-16 (SVN)
 New Comment:

Here is the link to the proposed patch :
http://bitbucket.org/basantk/php53perfpatches/raw/ca263ffd272b/safe_address_64bitopt_php53.txt

Richard Smith did the original work and I refined the patch.
In this proposed optimization we can check if the inputs are
sufficiently large enough so that overflow is possible. If overflow is
possible, regular double logic will follow.


Link the the mail sent to internals mailing list :
http://marc.info/?l=php-internals&m=126084384813237&w=2



Previous Comments:
------------------------------------------------------------------------

[2009-12-16 01:30:34] basant dot kukreja at gmail dot com

Description:
------------
safe_address function calculates nmemb * size + offset and it want to
make
sure that it output doesn't overflow.
It uses doubles for finding overflow which is very inefficent for
platforms
like sparc.


Reproduce code:
---------------
Any Php script causes _ecalloc function.

Expected result:
----------------
Good performance on platform other than gcc + x86_64 combo.

Actual result:
--------------
Poor _ecalloc performance on plaforms like Solaris.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50486&edit=1

Reply via email to