From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17476 invoked by alias); 7 Jan 2010 05:46:50 -0000 Received: (qmail 17466 invoked by uid 22791); 7 Jan 2010 05:46:49 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f219.google.com (HELO mail-bw0-f219.google.com) (209.85.218.219) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jan 2010 05:46:45 +0000 Received: by bwz19 with SMTP id 19so480045bwz.8 for ; Wed, 06 Jan 2010 21:46:43 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.10.144 with SMTP id p16mr2621126bkp.161.1262843201894; Wed, 06 Jan 2010 21:46:41 -0800 (PST) In-Reply-To: <4a00655d1001062110m139c0a8tf2eae7de67da8f6f@mail.gmail.com> References: <1259110486.3028.69.camel@manticore.lanl.gov> <4B4477B8.50305@iki.fi> <1262829020.27244.361.camel@manticore.lanl.gov> <4a00655d1001062110m139c0a8tf2eae7de67da8f6f@mail.gmail.com> From: Rhys Ulerich Date: Thu, 07 Jan 2010 05:46:00 -0000 Message-ID: <4a00655d1001062146g555fd9dfh1e333613d8e3b463@mail.gmail.com> Subject: Re: gsl container designs To: gsl-discuss@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org X-SW-Source: 2010-q1/txt/msg00007.txt.bz2 > I recall from my benchmarking days that -- depending on compiler -- > there is a small dereferencing penalty for packed matrices (vectors > packed into dereferencing **..* pointers) compared to doing the offset > arithmetic via brute force inline or via a macro. > ...... > I haven't > run the benchmark recently and don't know how large it currently is. =A0It > was never so large that it stopped me from using repacked pointers for > code clarity.. Mostly unscientific, but worth tossing into the mix: Using Intel 10.1 compilers on a fairly recent AMD chip, 100,000 iterations of doing the nested pointers approach is neck-and-neck with index arithmetic on a 10x10 double matrix. =A0For the 100x100 case it takes 1.3 times longer to iterate using the nested pointers. =A0Work in the inner loop "compute kernel" is *=3D against a constant scalar. =A0Optimization flags on -O3. =A0I've seen = similar behavior on recent GNU compilers. I'm happy to provide the test code if anyone's interested. - Rhys