Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80190 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48845 invoked from network); 5 Jan 2015 17:59:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 17:59:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=figureonecpr@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=figureonecpr@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.173 as permitted sender) X-PHP-List-Original-Sender: figureonecpr@gmail.com X-Host-Fingerprint: 74.125.82.173 mail-we0-f173.google.com Received: from [74.125.82.173] ([74.125.82.173:46735] helo=mail-we0-f173.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/95-21693-611DAA45 for ; Mon, 05 Jan 2015 12:59:51 -0500 Received: by mail-we0-f173.google.com with SMTP id q58so8416783wes.18 for ; Mon, 05 Jan 2015 09:59:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=jZIPl63o1TnbpWw3kl80NqFQp90D57w4frSGmM0pNVc=; b=ALVsi8UUVd57k5Ss3aCIUj9pDGB5notUDtdLSukIn+Ock9lNPJGbm69Yp0A5VQ++9y jq3QC76ucW8EcUtlLUQdrQ24Bt2qAcL7d6rf0gpIHC4Dyq/0iFNyWCOCg0uyXGy/gjBT /4sAEah+eMdAZskcBoIv2JhYuX/B3qKY1a7wGf+SFrYzNQKe+P6aok0WPIbNiI4zXfMB +VeGVcJNXMQijLq+1k4ILt+eYTbA3TV8dUawZHkHsmDigI7+Y9vup4ZAk+ad63dMOJDt AbQ02Lw7hD7oVJp3sjaHVBqLXMdFiydZIaI8wpN0xYWYNSeuzCG1pR+t4ebqARDnZIcL yjpg== MIME-Version: 1.0 X-Received: by 10.194.9.4 with SMTP id v4mr15892059wja.115.1420480786650; Mon, 05 Jan 2015 09:59:46 -0800 (PST) Received: by 10.217.66.71 with HTTP; Mon, 5 Jan 2015 09:59:46 -0800 (PST) In-Reply-To: <2F0DAC60-C06B-4C53-BE70-41B260C8093C@gmail.com> References: <2F0DAC60-C06B-4C53-BE70-41B260C8093C@gmail.com> Date: Mon, 5 Jan 2015 12:59:46 -0500 Message-ID: To: PHP Internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Re: Faster zend sorting implementation From: figureonecpr@gmail.com (Sanford Whiteman) Sounds more like a bugfix to me and def'ly an acceptable BC break in either case. The behavior isn't specified and if anything I would assume there _wouldn't_ be a swap with SORT_FLAG_CASE on. Interesting though that many sorting examples (across languages) sidestep this clearly common case. -- S. On Mon, Jan 5, 2015 at 12:36 PM, Xinchen Hui wrote: > Hey=EF=BC=9A > >> On Jan 6, 2015, at 1:27 AM, Julien Pauli wrote: >> >>> On Mon, Jan 5, 2015 at 6:09 PM, Xinchen Hui wrote: >>> On Tue, Jan 6, 2015 at 1:08 AM, Xinchen Hui wrote: >>> > Hey: >>> > >>> > I was working on zend_qsort improvement. but I got a problem nee= d >>> > to be disscussed with you fist.. >>> first >>> > >>> > as we know, previously zend_qsort is not a stable sorting algo. >>> > >>> > my draft patch (which already get 0.1% IRs reduce in wordpress) >>> > is kindof a stable sorting algo, you can find it here >>> > (https://github.com/laruence/php-src/compare/zend_sort) >>> > >>> > so, there is a bc break, like for : >>> > >>> > $array =3D array("o", "O"); >>> > sort($array, SORT_STRING|SORT_FLAG_CASE); >>> > >>> > var_dump($array); >>> > >>> > previously implementation does the swap: >>> > >>> > array(2) { >>> > [0]=3D> >>> > string(1) "O" >>> > [1]=3D> >>> > string(1) "o" >>> > } >>> > >>> > but new implementation doesn't not: >>> does not >>> > >>> > array(2) { >>> > [0]=3D> >>> > string(1) "o" >>> > [1]=3D> >>> > string(1) "O" >>> > } >> >> Hum, I dont think such a BC is acceptable. >> > I am not sure if you get the problem? > > "O" and "o" are equal is that script > > The flags means using case-insensitive string sorting mean > > Thanks >> There are tons of userland code out there relying on alpha case sorting = that could get impacted.... >> IMO :-) >> >> Q: why extract the swap function from the qsort algo ? Is there an inter= est of replacing it at runtime ? >> >> >> Julien.P