From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122919 invoked by alias); 25 May 2016 17:13:10 -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 122898 invoked by uid 89); 25 May 2016 17:13:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,MISSING_HEADERS,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=gentle, positions, H*r:esmtpa, Hx-spam-relays-external:esmtpa X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtpq4.tb.mail.iss.as9143.net Received: from smtpq4.tb.mail.iss.as9143.net (HELO smtpq4.tb.mail.iss.as9143.net) (212.54.42.167) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 25 May 2016 17:13:07 +0000 Received: from [212.54.42.115] (helo=lsmtp1.tb.mail.iss.as9143.net) by smtpq4.tb.mail.iss.as9143.net with esmtp (Exim 4.82) (envelope-from ) id 1b5cMi-0004Q5-Hg; Wed, 25 May 2016 19:13:04 +0200 Received: from i23017.upc-i.chello.nl ([62.195.23.17] helo=[192.168.0.16]) by lsmtp1.tb.mail.iss.as9143.net with esmtpa (Exim 4.82) (envelope-from ) id 1b5cMi-00072v-Fd; Wed, 25 May 2016 19:13:04 +0200 Subject: Re: [patch, libstdc++] std::shuffle: Generate two swap positions at a time if possible Cc: libstdc++ , gcc-patches References: <5728B8CC.7030405@eelis.net> Newsgroups: gmane.comp.gcc.patches From: Eelis Message-ID: <5745DD1B.20202@eelis.net> Date: Wed, 25 May 2016 19:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <5728B8CC.7030405@eelis.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Ziggo-spambar: / X-Ziggo-spamscore: 0.0 X-Ziggo-spamreport: CMAE Analysis: v=2.1 cv=BLVO1wkG c=1 sm=0 tr=0 a=9+rZDBEiDlHhcck0kWbJtElFXBc=:19 a=9cW_t1CCXrUA:10 a=IkcTkHD0fZMA:10 a=yrkiwgmsf1kA:10 a=tkoEZwNVuzPuNggp3icA:9 a=QEXdDO2ut3YA:10 a=-NFRlrBDBHoA:10 xcat=Undefined/Undefined none X-Ziggo-Spam-Status: No X-SW-Source: 2016-05/txt/msg02053.txt.bz2 >>> 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 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