comp.lang.ada
 help / color / mirror / Atom feed
From: Gautier <gautier@fakeaddress.nil>
Subject: Re: speed of generic code in Ada (vs Java)
Date: Sat, 17 May 2008 23:37:36 +0200
Date: 2008-05-17T23:37:36+02:00	[thread overview]
Message-ID: <482f5009$1_3@news.bluewin.ch> (raw)
In-Reply-To: <24bf14ef-ff0f-4309-88e0-550cd4a0dd9d@p25g2000pri.googlegroups.com>

jhc0033@gmail.com wrote:

> So, if I write a, say, linear equation solver using generics in Ada,
> and then instantiate it with single precision, double precision,
> complex number single precision and complex number double precision,
> you'd expect it to be as fast as the equivalent non-generic versions?

Exactly. For my PhD research I used generics to fill matrices with Finite 
Element integrals, whatever the format. It allowed to use the band format and 
Lapack for some problems and a sparse format and a totally different solver for 
other problems. The compiler (DEC Ada, now HP Ada) allowed to share (or not) 
generic instantiations.
AFAIK, the GNAT compiler always expands generics like macros and never shares, 
so you have something as fast as a copy-paste-modify non-generic code.
__________________________________________________________________
Gautier's Ada programming -- http://sourceforge.net/users/gdemont/

NB: For a direct answer, e-mail address on the Web site!



  parent reply	other threads:[~2008-05-17 21:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-16 17:31 speed of generic code in Ada (vs Java) jhc0033
2008-05-16 18:12 ` jimmaureenrogers
2008-05-16 18:54   ` Ludovic Brenta
2008-05-17  1:50     ` jhc0033
2008-05-17  2:04       ` Georg Bauhaus
2008-05-17  6:32       ` Niklas Holsti
2008-05-17  8:07       ` Ludovic Brenta
2008-05-17 21:37       ` Gautier [this message]
2008-05-17 23:31         ` Ivan Levashew
2008-05-22 22:01     ` Florian Weimer
2008-05-21  8:12   ` Graham
2008-05-21 15:41     ` Robert A Duff
2008-05-22  0:06       ` Randy Brukardt
2008-05-23 22:55         ` Robert A Duff
2008-05-24  0:16           ` Randy Brukardt
replies disabled

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