Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50060 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 68697 invoked from network); 1 Nov 2010 15:54:50 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Nov 2010 15:54:50 -0000 Authentication-Results: pb1.pair.com smtp.mail=lonnyk@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=lonnyk@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: lonnyk@gmail.com X-Host-Fingerprint: 209.85.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:52219] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/61-59907-8C2EECC4 for ; Mon, 01 Nov 2010 10:54:49 -0500 Received: by gxk3 with SMTP id 3so2012555gxk.29 for ; Mon, 01 Nov 2010 08:54:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=VbeAJPUm5Yid49QNfOzCpPN88VRKVrv6n/0In4hAqls=; b=q+vxz5dUJE2MboLu02MVfHQOd1IlJissvVnsJCyyTQAChy5y4xQb0u8kUe/aN/ZWw0 hFqSDCnc1yg8IFfaQHP1u7H00hLkRKtu3XUXrL1AzuhHwgSUDtM8Pp+j6hThVpF/h8qT 9fbZqEM7hFh+1xbtHPbM9AbxExcjtKB/Z1cMc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=Y8OLlV19lAClQII7HZTs1fqZbzLR3dweC6o859HTQ6QElqaajY9QimuqXs6ys2gCKI QvpusO7MiGnaTdF1iWTkR28bpA/0fDFmeooa0Q0REEwDr+9saTNKNmAWm4evNl+uGFLv U5+h1HhDZ6qHpqE0ljPATxCXpbe7HfHVF7618= MIME-Version: 1.0 Received: by 10.42.179.135 with SMTP id bq7mr411554icb.16.1288626885421; Mon, 01 Nov 2010 08:54:45 -0700 (PDT) Received: by 10.42.161.66 with HTTP; Mon, 1 Nov 2010 08:54:45 -0700 (PDT) In-Reply-To: References: Date: Mon, 1 Nov 2010 11:54:45 -0400 Message-ID: To: internals@lists.php.net Content-Type: multipart/alternative; boundary=90e6ba6e8116c0eb180493ffd310 Subject: Re: Bug #47643 - array_diff slowdown From: lonnyk@gmail.com (Lonny K) --90e6ba6e8116c0eb180493ffd310 Content-Type: text/plain; charset=ISO-8859-1 Can we get some opinions on this. I'm willing to make the changes, but I want to get some sort of consensus on this. Basically I believe the problem is that patch 42838 should be reverted and the documentation should be updated. Someone on IRC had disagreed with me so I want more opinions before I do anything. On Fri, Aug 27, 2010 at 4:01 AM, Lonny K wrote: > I wanted to discuss this bug to try to get it resolved. I briefly > discussed this over ICQ and had differing opinions then the person I was > talking to, so naturally I wanted a bigger audience. > > Quick summary of what's going on: > * 47643 is about array_diff being slow. > * This was caused by the patch for 42838 > * The problem with 42838 is basically that 0 != '0' > * Here is the diff: http://www.lonnylot.com/42838.diff > The lines that causes the slowdown are: > > - while (*ptrs[i] && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) { > - ptrs[i]++; > + while (*ptr && (0 < (c = diff_data_compare_func(ptrs[0], ptr TSRMLS_CC)))) { > + ptr++; > } > > > I feel the fix should be reverting 42838 because I feel 42838 wasn't a code > issue, but a documentation issue. It is noted in some places that comparing > a string to an integer results in the string being changed to 0. That is the > issue in 42838 and b/c this is excepted in other places it should be > excepted here. The documentation should be updated to say to typecast your > comparison to (string) if it is going to be important to your code. > --90e6ba6e8116c0eb180493ffd310--