comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Optimizing Ada
Date: Wed, 02 Oct 2013 08:16:02 +0100
Date: 2013-10-02T08:16:02+01:00	[thread overview]
Message-ID: <lyvc1gta6l.fsf@pushface.org> (raw)
In-Reply-To: 8aca502c-bba8-4af5-9192-459c15fe048b@googlegroups.com

kennethesills@gmail.com writes:

> So I was just wondering if anyone could help me optimize my Ada code a
> bit, as well as tell me how I'm doing in terms of general code style
> and idiomatic code writing.

Looks pretty good to me (we disagree about having a space between the
subprogram name and the opening paren, but then the ALRM is wrong about
that too :-)

I'm not sure that pragma Inline is meant to work when applied to a
subprogram body, so I'd apply it to the spec (I always write specs,
because I've set the GNAT style options to standard (-gnaty), and that
warns me about missing specs - and about missing spaces, see above).

GNAT may not have implemented your Inline anyway. There's a GNAT pragma
Inline_Always, and there are switches (-gnatn, -gnatN I think) that
affect inlining. The last time I did a check, inlining made my program
slower - cache effects, presumably. That was on powerpc.

AdaCore's house rules don't allow I as a variable name (confusion
potential), they start at J.

I wonder whether your performance problem is caused by using a function?
The internal Word_Map is, I think, going to be copied to the destination
and then finalized. Could you use an out parameter? (remembering to
clear it before adding ne new content).


  parent reply	other threads:[~2013-10-02  7:16 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02  2:58 Optimizing Ada kennethesills
2013-10-02  3:47 ` Jeffrey Carter
2013-10-02  3:53   ` kennethesills
2013-10-02  4:13     ` Jeffrey Carter
2013-10-02  4:24       ` kennethesills
2013-10-02  8:11         ` Jacob Sparre Andersen
2013-10-02 10:32           ` Marius Amado-Alves
2013-10-02 14:24           ` kennethesills
2013-10-02 16:41         ` Jeffrey Carter
2013-10-02 18:58       ` John B. Matthews
2013-10-02  7:01 ` Egil H H
2013-10-02  7:16 ` Simon Wright [this message]
2013-10-02 14:43   ` kennethesills
2013-10-02 10:24 ` Marius Amado-Alves
2013-10-02 14:29   ` kennethesills
replies disabled

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