hi :) On Mon, Jan 5, 2015 at 9:08 AM, Xinchen Hui <larue...@php.net> wrote: > Hey: > > I was working on zend_qsort improvement. but I got a problem need > to be disscussed with you fist.. > > 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 = array("o", "O"); > sort($array, SORT_STRING|SORT_FLAG_CASE); > > var_dump($array); > > previously implementation does the swap: > > array(2) { > [0]=> > string(1) "O" > [1]=> > string(1) "o" > } > > but new implementation doesn't not: > > array(2) { > [0]=> > string(1) "o" > [1]=> > string(1) "O" > } > > do you think such BC break is acceptable? or I still need a RFC? :<
I am not sure about that. Introducing a not easy to catch BC break for 0.1% gain on function (or even for the whole app) is not very appealing. However, there is nothing in the documentation actually describing how it works and there are clear warnings about the unpredictable results. That means we won't actually break it,per definition. I only wonder if it is worth the effort for such little gain (yes, the ocean is made of drops ;). Cheers, -- Pierre @pierrejoye | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php