Return-Path: X-Original-To: apmail-stdcxx-dev-archive@www.apache.org Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 63886DD71 for ; Sun, 30 Sep 2012 18:10:48 +0000 (UTC) Received: (qmail 37543 invoked by uid 500); 30 Sep 2012 18:10:48 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 37483 invoked by uid 500); 30 Sep 2012 18:10:48 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 37472 invoked by uid 99); 30 Sep 2012 18:10:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2012 18:10:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of msebor@gmail.com designates 209.85.160.54 as permitted sender) Received: from [209.85.160.54] (HELO mail-pb0-f54.google.com) (209.85.160.54) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 30 Sep 2012 18:10:38 +0000 Received: by pbbrp8 with SMTP id rp8so6795980pbb.41 for ; Sun, 30 Sep 2012 11:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=IyzyBUhflJNRrKNVHSEPFrRSbxRsIomAAmC9Ntfd+sU=; b=Xtilfi5faIKqHa3swGwFR7AyDaWGFEL4SdirJtwuTOOQ7RgLnOMhgyVNtv3fBnLUce +gBCNckOR6+ucw7+F0+DmKpZxg3adg1In+G4BXZWfq96cjTeougAL4Inwo3VJmQUAWon +2Yaqs59PhUhtfc2DDEEqT2VVasvnTg7k0EfG9lmI3vcSM2e7EUH4EzAmduDVOAsV/z2 4JYFGosRIB1ZAJEWOtRrxG9adw+u+oMTi1AoO1lez8gZe41hiDyfV8kLk1mF514+FtST na8ipdrfPQjz+kpK1KX+7tZO2CiShUkUDnV6+P0WyLbW0yCrJ1d32QFQxcYzmNATTIRh /8aQ== Received: by 10.66.85.233 with SMTP id k9mr31099543paz.73.1349028617295; Sun, 30 Sep 2012 11:10:17 -0700 (PDT) Received: from localhost.localdomain (72-163-0-129.cisco.com. [72.163.0.129]) by mx.google.com with ESMTPS id bj7sm9026243pab.24.2012.09.30.11.10.16 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 30 Sep 2012 11:10:16 -0700 (PDT) Message-ID: <50688B07.2080802@gmail.com> Date: Sun, 30 Sep 2012 12:10:15 -0600 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: "dev@stdcxx.apache.org" Subject: Re: STDCXX-1071 numpunct facet defect References: <506399E5.3050503@hates.ms> <50644977.3010503@hates.ms> <5064EEDA.2010004@gmail.com> <5064F11B.8010106@hates.ms> <50688AC6.1020300@gmail.com> In-Reply-To: <50688AC6.1020300@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit [Sending to dev after accidentally replying just to Liviu] On 09/30/2012 12:09 PM, Martin Sebor wrote: > On 09/27/2012 06:36 PM, Liviu Nicoara wrote: >> On 9/27/12 8:27 PM, Martin Sebor wrote: >>> On 09/27/2012 06:41 AM, Liviu Nicoara wrote: >>>> On 09/26/12 20:12, Liviu Nicoara wrote: >>>>> I have created STDCXX-1071 and linked to STDCXX-1056. [...] >>>>> >>>>> I am open to all questions, the more the better. Most of my opinions >>>>> have been expressed earlier, but please ask if you want to know more. >>>>> >>>> >>>> I am attaching here the proposed (4.3.x) patch and the timings results >>>> (after re-verifying the correctness of the timing program and the >>>> results). The 4.2.x patch, the 4.3.x patch, the test program and the >>>> results file are also attached to the incident. >>> >>> The patch isn't binary compatible. We can't remove data members >>> in a minor release. We could only do it in a major release. >> >> There are two of them, one for 4.2.x, one for 4.3.x. >> >>> >>> I'm still curious about the performance, though. It doesn't make >>> sense to me that a call to a virtual function is faster than one >>> to an almost trivial inline function. >> >> I scratched my head long on that. I wager that it depends on the >> machine, too. > > Here are my timings for library-reduction.cpp when compiled > GCC 4.5.3 on Solaris 10 (4 SPARCV9 CPUs). I had to make a small > number of trivial changes to get it to compile: > > With cache No cache > real 1m38.332s 8m58.568s > user 6m30.244s 34m25.942s > sys 0m0.060s 0m3.922s > > I also experimented with the program on Linux (CEL 4 with 16 > CPUs). Initially, I saw no differences between the two versions. > So I modified it a bit to make it closer to the library (the > modified program is attached). With those changes the timings > are below: > > With cache No cache > real 0m 1.107s 0m 5.669s > user 0m17.204s 0m 5.669s > sys 0m 0.000s 0m22.347s > > I also recompiled and re-ran the test on Solaris. To speed > things along, I set the number threads and loops to 8 and > 1000000. The numbers are as follows: > > With cache No cache > real 0m3.341s 0m26.333s > user 0m13.052s 1m37.470s > sys 0m0.009s 0m0.132s > > The numbers match my expectation. The overhead without the > "numpunct cache" is considerable. > > Somewhat unexpectedly, the test with the cache didn't crash. > > I also tried timing the numpunct patch attached to the issue > with the test program. The test program runs to completion > without the patch but it crashes with a SIGSEGV after the > patch is applied. That suggests there's a bug somewhere in > do_thousands_sep() (in addition to the caching). > > Martin > >> >> Let me know if there is anything I could help with. >> >> Liviu >