comp.lang.ada
 help / color / mirror / Atom feed
* Ada->C++ conversion stats?
@ 2000-03-21  0:00 tmoran
  2000-03-21  0:00 ` Robert L. Klungle
  0 siblings, 1 reply; 6+ messages in thread
From: tmoran @ 2000-03-21  0:00 UTC (permalink / raw)


Every once in a while we hear of something in Ada (presumably Ada 83)
being rewritten in C++.  When that happens, is there a complete
redesign, or just a transliteration?  If the former, how much effort
is the rewrite as compared to the original (I realize the second
time around is easier) and how does the result compare?  If a
transliteration, how much effort, how many old bugs discovered
and how much debugging time for new bugs and how does the result
compare to the original.  If no comparison is available, is it
because there's no record of the original or because there's no
measurement of the new version, or what?




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada->C++ conversion stats?
  2000-03-21  0:00 Ada->C++ conversion stats? tmoran
@ 2000-03-21  0:00 ` Robert L. Klungle
  2000-03-21  0:00   ` Hyman Rosen
                     ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robert L. Klungle @ 2000-03-21  0:00 UTC (permalink / raw)


tmoran@bix.com wrote:

> Every once in a while we hear of something in Ada (presumably Ada 83)
> being rewritten in C++.  When that happens, is there a complete
> redesign, or just a transliteration?  If the former, how much effort
> is the rewrite as compared to the original (I realize the second
> time around is easier) and how does the result compare?  If a
> transliteration, how much effort, how many old bugs discovered
> and how much debugging time for new bugs and how does the result
> compare to the original.  If no comparison is available, is it
> because there's no record of the original or because there's no
> measurement of the new version, or what?

I can report on the conversion of an image tracker (MHT) from Ada83 to
C++ (just finishing).
Total time so far is 3.5 months to translate.
If I had to do it over again, I wouldn't. The rigors of the Ada syntax
make the looseness of C/C++ stand out.
The C++ version execution time is 3 times slower than the original Ada.
Primarily due to the implementation of an Array (Matrix) class as a
Class of Vectors-of-Vectors.
This was done to keep the matrix type of referencing ([][]). There is no
C++ operator to overload of this kind.
This is not the only contributor to execution time increases.
The resulting code is clumsy compared to the original Ada.
All kinds of optimizations were/are being done to keep the speed up, but
the above is the best we have been able to do so far.
It works just like the original, but slower.

cheers...bob





^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada->C++ conversion stats?
  2000-03-21  0:00 ` Robert L. Klungle
  2000-03-21  0:00   ` Hyman Rosen
  2000-03-21  0:00   ` Hyman Rosen
@ 2000-03-21  0:00   ` Robert Dewar
  2 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 2000-03-21  0:00 UTC (permalink / raw)


In article <38D722C1.8B6C58F7@gte.net>,
  "Robert L. Klungle" <bklungle@gte.net> wrote:
> All kinds of optimizations were/are being done to keep the
speed up, but
> the above is the best we have been able to do so far.
> It works just like the original, but slower.

One has to wonder whose money was spent in this useless
excercise :-)


Sent via Deja.com http://www.deja.com/
Before you buy.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada->C++ conversion stats?
  2000-03-21  0:00 ` Robert L. Klungle
  2000-03-21  0:00   ` Hyman Rosen
@ 2000-03-21  0:00   ` Hyman Rosen
  2000-03-21  0:00   ` Robert Dewar
  2 siblings, 0 replies; 6+ messages in thread
From: Hyman Rosen @ 2000-03-21  0:00 UTC (permalink / raw)


"Robert L. Klungle" <bklungle@gte.net> writes:
> The C++ version execution time is 3 times slower than the original Ada.
> Primarily due to the implementation of an Array (Matrix) class as a
> Class of Vectors-of-Vectors.
> This was done to keep the matrix type of referencing ([][]). There is no
> C++ operator to overload of this kind.

You should certainly not implement (non-sparse) matrices as vectors
of vectors! I would advise you to get a copy of Barton & Nackman's
"Scientific and Engineering C++". There are all sorts of efficient
algorithms in there for implementing matrices while preserving the
[][] C++ array referencing syntax.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada->C++ conversion stats?
  2000-03-21  0:00 ` Robert L. Klungle
@ 2000-03-21  0:00   ` Hyman Rosen
  2000-03-22  0:00     ` Gerald Kasner
  2000-03-21  0:00   ` Hyman Rosen
  2000-03-21  0:00   ` Robert Dewar
  2 siblings, 1 reply; 6+ messages in thread
From: Hyman Rosen @ 2000-03-21  0:00 UTC (permalink / raw)


"Robert L. Klungle" <bklungle@gte.net> writes:
> The C++ version execution time is 3 times slower than the original Ada.
> Primarily due to the implementation of an Array (Matrix) class as a
> Class of Vectors-of-Vectors.
> This was done to keep the matrix type of referencing ([][]). There is no
> C++ operator to overload of this kind.

In addition to the B&N book, you should also look at the Blitz++ library.
It uses the expression template technique to convert concisely written
matrix operations into the equivalent of hand-optimized loops. It's free.
See <http://oonumerics.org/blitz/index.html>.




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Ada->C++ conversion stats?
  2000-03-21  0:00   ` Hyman Rosen
@ 2000-03-22  0:00     ` Gerald Kasner
  0 siblings, 0 replies; 6+ messages in thread
From: Gerald Kasner @ 2000-03-22  0:00 UTC (permalink / raw)


Hyman Rosen wrote:
> 
> "Robert L. Klungle" <bklungle@gte.net> writes:
> > The C++ version execution time is 3 times slower than the original Ada.
> > Primarily due to the implementation of an Array (Matrix) class as a
> > Class of Vectors-of-Vectors.
> > This was done to keep the matrix type of referencing ([][]). There is no
> > C++ operator to overload of this kind.
> 
> In addition to the B&N book, you should also look at the Blitz++ library.
> It uses the expression template technique to convert concisely written
> matrix operations into the equivalent of hand-optimized loops. It's free.
> See <http://oonumerics.org/blitz/index.html>.

Rather than using blitz or something like that, I would prefer libblas,
which 
is highly tuned and available for various platforms. C bindings should
be available 
at netlib.org.
If the matrix operations are responsible for the slowness, the use of
blas would 
give incredible speedups, even in the Ada version.

-Gerald




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2000-03-22  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-03-21  0:00 Ada->C++ conversion stats? tmoran
2000-03-21  0:00 ` Robert L. Klungle
2000-03-21  0:00   ` Hyman Rosen
2000-03-22  0:00     ` Gerald Kasner
2000-03-21  0:00   ` Hyman Rosen
2000-03-21  0:00   ` Robert Dewar

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