comp.lang.ada
 help / color / mirror / Atom feed
From: stefan-lucks@see-the.signature
Subject: Re: Access keyword
Date: Tue, 29 Apr 2008 17:16:42 +0200
Date: 2008-04-29T17:16:42+02:00	[thread overview]
Message-ID: <Pine.LNX.4.64.0804291715110.30206@medsec1.medien.uni-weimar.de> (raw)
In-Reply-To: <fv79c8$lik$1@registered.motzarella.org>

You should do some bechmarks. My guess is that on any decent compiler with
full optimisation switched on, the two are running at exactly the same
speed.

In general, avoiding the access keyword gives the compiler more options to
optimise the code, so if either function is faster than the other one,
Norme ought to be faster than NormeAccess.

> I read that Ada compiler choose if a reference or a value mode is used
> in the Norme function,

True. You don't need the access keyword to force the compiler to
(internally) using pointers ...

> so it would mean that the access keyword should
> be used only for runtime allocated variable.

This is a good rule of thumb. Actually, there are other legitimate uses of 
the access keyword. But optimising for speed is really bad usage of 
access, and may even fire back (degrade the performance, rather than 
improve it).



-- 
------ Stefan Lucks   --  Bauhaus-University Weimar  --   Germany  ------
               Stefan dot Lucks at uni minus weimar dot de
------  I  love  the  taste  of  Cryptanalysis  in  the  morning!  ------




  parent reply	other threads:[~2008-04-29 15:16 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 13:55 Access keyword Sébastien
2008-04-29 14:35 ` Peter Hermann
2008-04-29 14:43 ` Ludovic Brenta
2008-04-29 15:16 ` stefan-lucks [this message]
2008-04-29 16:31   ` Sébastien
2008-04-29 19:55     ` Gautier
2008-04-30 14:26       ` Sébastien
2008-04-30 17:13         ` Gautier
2008-04-30 20:44         ` Ludovic Brenta
2008-04-29 17:37 ` Adam Beneschan
2008-04-29 19:08 ` Jeffrey R. Carter
2008-04-29 21:03 ` Maciej Sobczak
2008-04-29 21:32 ` Randy Brukardt
2008-04-30  4:36   ` Gautier
2008-04-30  7:15   ` Maciej Sobczak
2008-04-30  7:56     ` Dmitry A. Kazakov
2008-04-30  9:21     ` Georg Bauhaus
2008-04-30 15:16     ` Adam Beneschan
2008-04-30 15:20     ` Adam Beneschan
2008-04-30 21:32       ` Maciej Sobczak
2008-04-30 21:58         ` Adam Beneschan
2008-05-01  1:10         ` Adam Beneschan
2008-04-30 23:40       ` Randy Brukardt
2008-04-30 14:32   ` Sébastien
replies disabled

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