Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80216 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6247 invoked from network); 6 Jan 2015 02:40:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 6 Jan 2015 02:40:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.215.49 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:38828] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AE/DF-21693-61B4BA45 for ; Mon, 05 Jan 2015 21:40:22 -0500 Received: by mail-la0-f49.google.com with SMTP id hs14so19441102lab.36 for ; Mon, 05 Jan 2015 18:40:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=a1WQ2aH0JW3Fjrg3n5LD/sE00TyxNOGXt/2oCTqCjt8=; b=FWuhx+EOVxzZE/m9c7TnlcMPxEhyIjCV0rH2gNq8H40rFHo5vmb9ekDpNz9WwSfoxi ygclYJzfcdV+TTSPeIvY2JS1NxlOzVhqyBmaIEYeC+zxhArXZD1lngQr00NYsjjr6G0x /eI1E9zMnXVdcgi2W+WDoci6Xxg5fK1q8g1UFLYCb7TiJ41VSTVBJfRNwhMIcF/CJ/Vf 1fV4YG9yU7pGE3ETZSuow4r9gkxQDtyPlB48It8EE8tzIVawSWQv40TEBbIL90jrCwXL 0yizPeUqPxJD/Km7XT3484E739Wwc+cldZopZ8UB6eZ+29HssACJHeCgRYyEzdlpUV3Z 4lqg== X-Gm-Message-State: ALoCoQl9s++PdiCc/VE45vMpJtQcaH7r6KBe/fDIkoZi6gBoVuqrtb5coMn7/q0ioMk8u0Lbm3vruv7Hbm/vy2BySY2xWQx2lIj89JRCnJa9ANwN8iRjxyfYmaBfjECtAk0k1aXljg6xORimDVtq7BtyiWhoY5czQg== X-Received: by 10.112.145.37 with SMTP id sr5mr98782111lbb.76.1420512019253; Mon, 05 Jan 2015 18:40:19 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPSA id jg8sm15078546lbc.0.2015.01.05.18.40.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 Jan 2015 18:40:18 -0800 (PST) Received: by mail-lb0-f181.google.com with SMTP id l4so18477129lbv.26 for ; Mon, 05 Jan 2015 18:40:17 -0800 (PST) X-Received: by 10.112.17.102 with SMTP id n6mr94398905lbd.39.1420512017683; Mon, 05 Jan 2015 18:40:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Mon, 5 Jan 2015 18:39:57 -0800 (PST) In-Reply-To: <54AAD22C.2010805@bastelstu.be> References: <54AAD22C.2010805@bastelstu.be> Date: Tue, 6 Jan 2015 10:39:57 +0800 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: PHP Internals , Dmitry Stogov , Nikita Popov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Faster zend sorting implementation From: laruence@php.net (Xinchen Hui) On Tue, Jan 6, 2015 at 2:04 AM, Tim D=C3=BCsterhus wrote= : > On 05.01.2015 18:08, Xinchen Hui wrote: >> do you think such BC break is acceptable? or I still need a RFC? :< >> > > Chiming in as a pure userland developer. The documentation already states= : > >> Note: Like most PHP sorting functions, sort() uses an implementation > of =C2=BB Quicksort. The pivot is chosen in the middle of the partition > resulting in an optimal time for already sorted arrays. This is however > an implementation detail you shouldn't rely on. thanks, then I think no problem. the reason why I asked is I found lots of test scripts starts to fail, they all rely on the current non-stable sorting algo :< thanks > > As the selection of the pivot element may also affect the order of equal > elements and is explicitly defined as =E2=80=9Cone should not rely on it= =E2=80=9D this > change seems to be fine from my perspective. > > Tim --=20 Xinchen Hui @Laruence http://www.laruence.com/