Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25082 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84816 invoked by uid 1010); 1 Aug 2006 18:02:06 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 84801 invoked from network); 1 Aug 2006 18:02:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Aug 2006 18:02:06 -0000 X-PHP-List-Original-Sender: andrei@gravitonic.com X-Host-Fingerprint: 204.11.219.139 lerdorf.com Linux 2.5 (sometimes 2.4) (4) Received: from ([204.11.219.139:60946] helo=lerdorf.com) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id 46/C4-45114-A179FC44 for ; Tue, 01 Aug 2006 14:02:04 -0400 Received: from [66.228.175.145] (borndress-lm.corp.yahoo.com [66.228.175.145]) (authenticated bits=0) by lerdorf.com (8.13.7/8.13.7/Debian-1) with ESMTP id k71I1whg005067; Tue, 1 Aug 2006 11:01:59 -0700 In-Reply-To: <001501c6b47f$7ee8f380$0201a8c0@pc1> References: <001501c6b47f$7ee8f380$0201a8c0@pc1> Mime-Version: 1.0 (Apple Message framework v623) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: Date: Tue, 1 Aug 2006 11:02:36 -0700 To: "Matt W" X-Mailer: Apple Mail (2.623) Subject: Re: [PHP-DEV] zend_u_strtod is slow - possible fix From: andrei@gravitonic.com (Andrei Zmievski) Yes. With your patch applied, the numeric unicode string to double conversion is about 100% slower than from binary strings. If this is acceptable we can commit the patch. Otherwise, we should port zend_strtod() to deal with unicode strings directly. -Andrei On Jul 31, 2006, at 1:58 AM, Matt W wrote: > 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 > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php