Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80451 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63272 invoked from network); 14 Jan 2015 10:00:17 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 10:00:17 -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.217.177 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.217.177 mail-lb0-f177.google.com Received: from [209.85.217.177] ([209.85.217.177:61662] helo=mail-lb0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/50-61073-92E36B45 for ; Wed, 14 Jan 2015 05:00:12 -0500 Received: by mail-lb0-f177.google.com with SMTP id b6so7025147lbj.8 for ; Wed, 14 Jan 2015 02:00:04 -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:content-type; bh=9UYndRIqf8fqMGVgPuNC7Mu9efBFcYwl2ymPFIki+eM=; b=fWNZ4xjwRkUl2O+vnxrobpcVLk6lT0TgZSrC7gJWFi9T1tpjiVp+ClqQIJDPB7ykYf YdiPsnQ4cHgSApe4EzHrivKUORYbiy6SQ2qrRZaLRFFcCkPRTyLVg6I1wycSb0fD58u3 x2mcai/cX9ib9gNDH4NqKar9L3YmcHmA9gHpKRZ7bnte2AUZ6okiVZUhLghztBij/FNS DETMJwJSqRyzUe7kbVPqgTfYXEUAmDCEc4TnybLD2s0Pq0Y8zvPkvo3v1tXzS62ar2+9 70vwKUMcEqvMe4BiP/LRzjGlT1ojXZJFGP3oQLLEaaAHE9PIbp6sRuI/hi5eDa5D+1qf IRVA== X-Gm-Message-State: ALoCoQksTEdrIKi3py2nGFtSvYUoDNbcXDP2vzT+Ro4k/TBnXqyI59qbNLZ9G6UPC+U4Q208ZJfZuvcypXo7uEzMxwHmjfzlhJYhRltu3fQjDxyuJOmThUORF+dYm0/DTW4ZDqjxJQQltpviPMHwS0vkQHUG4EPLhg== X-Received: by 10.112.72.197 with SMTP id f5mr2895827lbv.21.1421229604394; Wed, 14 Jan 2015 02:00:04 -0800 (PST) Received: from mail-la0-f46.google.com (mail-la0-f46.google.com. [209.85.215.46]) by mx.google.com with ESMTPSA id w9sm1597981laj.13.2015.01.14.02.00.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 Jan 2015 02:00:02 -0800 (PST) Received: by mail-la0-f46.google.com with SMTP id q1so7233338lam.5 for ; Wed, 14 Jan 2015 02:00:02 -0800 (PST) X-Received: by 10.112.56.142 with SMTP id a14mr2985475lbq.16.1421229602093; Wed, 14 Jan 2015 02:00:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.64.176 with HTTP; Wed, 14 Jan 2015 01:59:41 -0800 (PST) In-Reply-To: References: Date: Wed, 14 Jan 2015 17:59:41 +0800 Message-ID: To: PHP Internals , Dmitry Stogov , Nikita Popov Content-Type: text/plain; charset=UTF-8 Subject: Re: Faster zend sorting implementation From: laruence@php.net (Xinchen Hui) Hey: I made a PR here: https://github.com/php/php-src/pull/999 for reviewing in benchmark this can brings more than 30% performance gain in array_sort etc functions. tests fails are related to non-stable vs stable sorting difference. anyway, I feel it's better to ask you to do a final review, what do you think? is there any objections to merge this? thanks 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 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? :< > > thanks > -- > Xinchen Hui > @Laruence > http://www.laruence.com/ -- Xinchen Hui @Laruence http://www.laruence.com/