comp.lang.ada
 help / color / mirror / Atom feed
From: "Peter C. Chapin" <pcc482719@gmail.com>
Subject: Re: Interesting performance quirk.
Date: Thu, 30 Oct 2008 07:15:21 -0400
Date: 2008-10-30T07:15:21-04:00	[thread overview]
Message-ID: <49099749$0$5760$4d3efbfe@news.sover.net> (raw)
In-Reply-To: <87y707i29v.fsf@mid.deneb.enyo.de>

Florian Weimer wrote:

> Is memory allocation or finalization involved in an inner loop?
> It might also help to compare -gnatdg output or assembly (-S).

No, the inner loop is pretty much plain computation. The array over
which I work is dynamically allocated, however. So I suppose the Ada
version is doing checks to make sure the access value that points at the
array isn't null, whereas the C version is probably not doing that. I'm
not sure how much of an effect those null checks would have, though.
Blowfish's uses 16 "rounds" on each block so depending on where the
checks are done they could be lost in the overhead of the algorithm...
or not.

As Martin said in another post, I understand that by making some
adjustments to the code one can often coax the compiler to skip checks
that are actually unnecessary without violating the semantics of Ada. I
will definitely have to look into that. Thanks for your suggests above
for getting further information. I would definitely like to understand
*why* the code is slow before spending too much time try to fix it. I've
optimized code before (not Ada code) and I know that just guessing about
the problem often doesn't work well.

Peter



  reply	other threads:[~2008-10-30 11:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-26  0:57 Interesting performance quirk Peter C. Chapin
2008-10-26  2:15 ` Jeffrey Creem
2008-10-26 11:16   ` Peter C. Chapin
2008-10-26  4:57 ` tmoran
2008-10-26 11:11   ` Peter C. Chapin
2008-10-28  8:49     ` Martin
2008-10-28 11:35       ` Peter C. Chapin
2008-10-28 14:21         ` Robert A Duff
2008-10-29  1:42           ` Peter C. Chapin
2008-10-28 18:27         ` Jeffrey R. Carter
2008-10-29  1:39           ` Peter C. Chapin
2008-10-29  5:27             ` Jeffrey R. Carter
2008-10-28 23:22         ` Ludovic Brenta
2008-10-29  8:42           ` oenone
2008-10-29  9:59           ` Peter C. Chapin
2008-10-29 10:19             ` Martin
2008-11-17  6:31             ` David Thompson
2008-11-17 11:51               ` Peter C. Chapin
2008-10-29  9:54         ` Alex R. Mosteo
2008-10-30 11:16           ` Peter C. Chapin
2008-10-29 16:12         ` Colin Paul Gloster
2008-10-30 11:23           ` Peter C. Chapin
2008-10-31 13:41             ` Colin Paul Gloster
2008-11-01 15:41               ` Gene
2008-10-29 20:18 ` Florian Weimer
2008-10-30 11:15   ` Peter C. Chapin [this message]
2008-11-07  0:44 ` Randy Brukardt
2008-11-07  1:23   ` Peter C. Chapin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox