[RFC] Add grisu3 strtod algorithm

php.internals

David Soria Parra

15 years ago
Hi Internals, I want to propose the inclusion of Florian Loitschs (called grisu3) strtod algorithm. Essentially Florian found a new algorithm for string to double conversion and vice versa. According to micro benchmarks in PHP and experiences with the library in the haskell community, this can speed up heavy conversions like json_decode up to 20-30%. It is a backward compatible change as we will not change the underlying zend_strtod api. The proposed change is enabled with a flag and will be disabled by default. As no underlying API is affected and because it's disabled by default, I propose this change to be included in PHP 5.4. I'll finish the patch before alpha3. The RFC an be found here: https://wiki.php.net/rfc/grisu3-strtod - David

Christopher Jones

15 years ago
On 07/15/2011 09:52 AM, David Soria Parra wrote:
> The RFC an be found here: > > https://wiki.php.net/rfc/grisu3-strtod > > - David
- Can you add the micro benchmarks to the RFC? - Do you have any wider benchmarks? - Can you state the impact to code size etc? - What about renaming –enable-grisu3 to include "performance" in the option name? This would make it more visible and therefore be used in more builds. Chris
-- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/