Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26462 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 38795 invoked by uid 1010); 10 Nov 2006 12:22:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 38779 invoked from network); 10 Nov 2006 12:22:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Nov 2006 12:22:17 -0000 Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:15875] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6D/00-37447-FDE64554 for ; Fri, 10 Nov 2006 07:21:54 -0500 Received: (qmail 22528 invoked from network); 10 Nov 2006 12:20:22 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 10 Nov 2006 12:20:22 -0000 Message-ID: <45546EDB.2020400@zend.com> Date: Fri, 10 Nov 2006 15:21:47 +0300 User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Matt Wilmas CC: php-dev References: <455455D1.3020706@zend.com> <017f01c704b9$5e07f870$0201a8c0@pc1> In-Reply-To: <017f01c704b9$5e07f870$0201a8c0@pc1> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] zend_u_strtod() 400% speed up From: antony@zend.com (Antony Dovgal) On 11/10/2006 02:14 PM, Matt Wilmas wrote: > Hi Antony, > > ----- Original Message ----- > From: "Antony Dovgal" > Sent: Friday, November 10, 2006 > >> Hello all. >> >> I would like to propose a replacement for current zend_u_strtod() > implementation. >> The patch: http://tony2001.phpclub.net/dev/tmp/u_strtod.diff >> >> According to my tests, new implementation is faster in about 40 (forty) > times. >> The simple script below takes ~1 sec to run with the patch and ~40 seconds > without. > > Cool. :-) I'd just been thinking about zend_u_strtod() again -- if you see > my thread asking Andrei about the Unicode characters allowed as numbers... > I changed the function back in the summer to be about 8x faster by > converting FROM Unicode and using the regular zend_strtod(), but it was just > a quick hack, so maybe better that it wasn't applied! > http://realplain.com/php/zend_u_strtod.diff Hmm.. Actually, your version seems to be slightly faster (~15%) than mine and there are several advantages, like no formatter is required, avoiding parsing non-numeric strings and less TSRMLS_FETCH() calls, which leads to even better results on non-numeric strings. Also, it looks like a good idea to use zend_strtod() in both native and unicode modes. > BTW, your version would actually be 4000% faster, no? :-O Yeah, not enough blood in my coffein =) -- Wbr, Antony Dovgal