Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80192 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52104 invoked from network); 5 Jan 2015 18:12:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jan 2015 18:12:31 -0000 Authentication-Results: pb1.pair.com smtp.mail=dz@heroku.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dz@heroku.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain heroku.com designates 74.125.82.44 as permitted sender) X-PHP-List-Original-Sender: dz@heroku.com X-Host-Fingerprint: 74.125.82.44 mail-wg0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:48763] helo=mail-wg0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 16/46-21693-D04DAA45 for ; Mon, 05 Jan 2015 13:12:30 -0500 Received: by mail-wg0-f44.google.com with SMTP id b13so28254556wgh.31 for ; Mon, 05 Jan 2015 10:12:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=19X6xJVjQ9Q991PAOVkPV5Til3Lc84fDjkPlxxIlkf8=; b=JX0VzkGiDQR4V1Nil9GCEYyj/j6M8PC28EiMZhxrLZJCDyGHli4TgZeWWqjrpVibPX /6chDre0Viath0VIKk3cqhhuTMF8CYN54AqAKb0jxFJgpneSyILEpcKPzOpVre75Lzzv hghxYy3AmqhXxVGT1bl/qaAstk+V9pPLQACIvjkXNTjLsyTKsUG3+9zYCdWu/f8LPOf0 RcH4Ag2Y3oaiyJn/zxfxzGSlOTfE3NLBFAEHd5iAd4EH6YW2MgvmBqx7NSwY6YIQCVSE SL00Ud351ZmZlF3e4mGsPxIFflh06uiJHIf/tg42x/yA5ymAubbuq7E15Afqxdl7K5iX doxQ== X-Gm-Message-State: ALoCoQlD6cQnp0oGDKTpVfT4DBUT/pyoWcuTDA4B6aLqN4MUKbAs5gUmooIbD5P2NR2D2IUOtszp X-Received: by 10.194.90.81 with SMTP id bu17mr90333336wjb.3.1420481545309; Mon, 05 Jan 2015 10:12:25 -0800 (PST) Received: from [192.168.19.5] (ipbcc0d8c7.dynamic.kabel-deutschland.de. [188.192.216.199]) by mx.google.com with ESMTPSA id kn5sm76294314wjb.48.2015.01.05.10.12.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Jan 2015 10:12:24 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) In-Reply-To: Date: Mon, 5 Jan 2015 19:12:22 +0100 Cc: PHP Internals , Dmitry Stogov , Nikita Popov Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Xinchen Hui X-Mailer: Apple Mail (2.1993) Subject: Re: [PHP-DEV] Faster zend sorting implementation From: dz@heroku.com (David Zuelke) This sounds reasonable, because given how the sort is *not* stable, = there will be other cases (totally made up, but let's say ["a", "o", = "O"]) where the swap does *not* happen. Consistency, and thus a stable = sort, is better. But you're saying your patch is "kind of a" stable sorting algo, so is = it stable only sometimes, or did you mean to say "a kind of"? David > On 05.01.2015, at 18:08, Xinchen Hui wrote: >=20 > Hey: >=20 > I was working on zend_qsort improvement. but I got a problem need > to be disscussed with you fist.. >=20 > as we know, previously zend_qsort is not a stable sorting algo. >=20 > 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) >=20 > so, there is a bc break, like for : >=20 > $array =3D array("o", "O"); > sort($array, SORT_STRING|SORT_FLAG_CASE); >=20 > var_dump($array); >=20 > previously implementation does the swap: >=20 > array(2) { > [0]=3D> > string(1) "O" > [1]=3D> > string(1) "o" > } >=20 > but new implementation doesn't not: >=20 > array(2) { > [0]=3D> > string(1) "o" > [1]=3D> > string(1) "O" > } >=20 > do you think such BC break is acceptable? or I still need a RFC? :< >=20 > thanks > --=20 > Xinchen Hui > @Laruence > http://www.laruence.com/ >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20