From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124035 invoked by alias); 25 May 2016 17:13:19 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 123934 invoked by uid 89); 25 May 2016 17:13:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=gentle, HX-Envelope-From:sk:gcc-pat, positions X-HELO: plane.gmane.org Received: from plane.gmane.org (HELO plane.gmane.org) (80.91.229.3) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 25 May 2016 17:13:11 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1b5cMk-0006lg-Vr for gcc-patches@gcc.gnu.org; Wed, 25 May 2016 19:13:07 +0200 Received: from i23017.upc-i.chello.nl ([62.195.23.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 19:13:06 +0200 Received: from eelis by i23017.upc-i.chello.nl with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 25 May 2016 19:13:06 +0200 To: gcc-patches@gcc.gnu.org From: Eelis Subject: Re: [patch, libstdc++] std::shuffle: Generate two swap positions at a time if possible Date: Wed, 25 May 2016 20:45:00 -0000 Message-ID: <5745DD1B.20202@eelis.net> References: <5728B8CC.7030405@eelis.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: libstdc++ , gcc-patches User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 In-Reply-To: <5728B8CC.7030405@eelis.net> X-IsSubscribed: yes X-SW-Source: 2016-05/txt/msg02054.txt.bz2 Message-ID: <20160525204500.sD__Ksifztg0EeGYtBu8JqSPSv34MDUu00SahZ9QgdU@z> >>> On 2016-05-01 16:18, Eelis wrote: >>>> The attached patch optimizes std::shuffle for the very common case >>>> where the generator range is large enough that a single invocation >>>> can produce two swap positions. >>>> >>>> This reduces the runtime of the following testcase by 37% on my machine: Gentle ping. :) Did anyone get a chance to take a look at this? Does the idea seem sound? Does the implementation seem correct? Thanks, Eelis