Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25072 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97771 invoked by uid 1010); 31 Jul 2006 08:58:34 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 97756 invoked from network); 31 Jul 2006 08:58:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2006 08:58:34 -0000 X-PHP-List-Original-Sender: php_lists@realplain.com X-Host-Fingerprint: 69.179.208.43 msa3-mx.centurytel.net Linux 2.4/2.6 Received: from ([69.179.208.43:50765] helo=msa3-mx.centurytel.net) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 49/9A-35486-936CDC44 for ; Mon, 31 Jul 2006 04:58:34 -0400 Received: from pc1 (69-29-175-187.dyn.centurytel.net [69.29.175.187]) by msa3-mx.centurytel.net (8.13.6/8.13.6) with SMTP id k6V8wTnP000620 for ; Mon, 31 Jul 2006 03:58:30 -0500 Message-ID: <001501c6b47f$7ee8f380$0201a8c0@pc1> To: Date: Mon, 31 Jul 2006 03:58:30 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Subject: zend_u_strtod is slow - possible fix From: php_lists@realplain.com ("Matt W") Hi all, As I was working on upgrading the dec[bin|hex|oct] functions to convert large doubles, I noticed how much slower things were when converting Unicode strings to double. I found that converting the whole thing to string and using regular zend_strtod() was much faster. Then I decided to try modifying the u_strtod() function to do the same, but just on the relevant numeric portion. I don't know if I did everything right, but it seems to work fine with my limited testing. (I was working from zend_u_strtol() and zval_unicode_to_string_ex(). :-)) The function is now about *8 times* faster, and nearly 20 times faster on a non-numeric string! (I'm on Windows.) diff: http://realplain.com/php/zend_u_strtod.diff Is this something that can be used? Thanks, Matt