Re: Faster zend sorting implementation

From: Date: Tue, 06 Jan 2015 03:40:53 +0000
Subject: Re: Faster zend sorting implementation
References: 1 2 3  Groups: php.internals 
Request: Send a blank email to internals+get-80217@lists.php.net to get a copy of this message
On 5 January 2015 at 18:39, Xinchen Hui <laruence@php.net> wrote: > On Tue, Jan 6, 2015 at 2:04 AM, Tim Düsterhus <tim@bastelstu.be> 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 » 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 :< We make no promises about the implementation on any of the relevant documentation pages, besides that it's a quick sort, and we explicitly say that you can't rely on that. I think we can change this without a real BC concern (although it would still be worth noting in UPGRADING and, by extension, the migration guide). Adam

« previous php.internals (#80217) next »