comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GNAT: Performance of String functions
Date: 1997/07/18
Date: 1997-07-18T00:00:00+00:00	[thread overview]
Message-ID: <dewar.869241859@merv> (raw)
In-Reply-To: 33CF3908.3DF62EEE@ericsson.com


Jakob asks

<<I wonder if there exist some data concerning speed issuses
on different types of string handling. To be specific what
type och string mechanism is considered fastest and how big
is the difference between strings, bounded strings an unbounded
strings? Speed measurement in comparing two strings, passing
as a parameter, passing as a parameter to procedure in another
package.

I'm running GNAT 3.09 on a Sun Sparc Ultra 1 with Solaris 2.5.
I'm using unbounded strings and I'm comparing a lot. In fact
I have an equvalent program running the same algoritm in VAX
Pascal, and on the VAX the program runs about ten times faster.
Can I expect a dramatic speed improvement if I use another
string concept or is GNAT just slow?

>>


A couple of notes. First all strings are passed by reference in all cases,
so that is definitely not an issue.

I doubt you could have an equivalent algorithm in VAX Pascal, although I don't
know VAX Pascal that well. In particular, what does the VAX Pascal use -- I
bet it either uses the equivalent of bounded strings, or it does not have
automatic finalization. The unboundedness you certainly pay a price for,
and you also pay a price for the automatic finalization.

And also, it would be interesting to see a distilled benchmark. When we
look at such code, we often find it is apples vs oranges comparisons,
and that in particular if some foreign language code has been simplistically
translated to Ada, it has ended up as non-idiomatic Ada which can be expected
to run slower. A factor of 10x smacks of that kind of phenomenon.

The GNAT code for unbounded strings is relatively straightforward (you
can look at it easily!) There may be places it can be speeded up, but there
is nothing like a 10x factor of inefficiency in the coding that I know of





  reply	other threads:[~1997-07-18  0:00 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-07-18  0:00 GNAT: Performance of String functions Jakob Heinemann
1997-07-18  0:00 ` Robert Dewar [this message]
1997-07-19  0:00   ` Tarjei T. Jensen
1997-07-19  0:00     ` Matthew Heaney
1997-07-20  0:00     ` Tarjei T. Jensen
1997-07-20  0:00     ` Robert Dewar
1997-07-20  0:00       ` Tarjei T. Jensen
1997-07-20  0:00         ` Robert Dewar
1997-07-21  0:00           ` Tucker Taft
1997-07-21  0:00             ` Tarjei Jensen
1997-07-21  0:00               ` Matthew Heaney
1997-07-22  0:00               ` Robert Dewar
1997-07-22  0:00                 ` Tarjei Jensen
1997-07-22  0:00                   ` Larry Kilgallen
1997-07-22  0:00                     ` Tarjei T. Jensen
1997-07-23  0:00                       ` Larry Kilgallen
1997-07-23  0:00                       ` Robert Dewar
1997-07-23  0:00                         ` Tarjei Jensen
1997-07-23  0:00                           ` Samuel Mize
1997-07-23  0:00                             ` W. Wesley Groleau x4923
1997-07-24  0:00                             ` Robert A Duff
1997-07-24  0:00                           ` Mats Weber
1997-07-24  0:00                             ` Matthew Heaney
1997-07-24  0:00                             ` Robert Dewar
1997-07-28  0:00                               ` Mats Weber
1997-07-28  0:00                                 ` Robert Dewar
1997-07-28  0:00                                   ` Robert Dewar
1997-07-28  0:00                                 ` Matthew Heaney
1997-07-29  0:00                                   ` Robert Dewar
1997-07-24  0:00                             ` Tarjei Jensen
1997-07-24  0:00                               ` Matthew Heaney
1997-07-24  0:00                               ` Robert Dewar
1997-07-22  0:00                   ` Robert Dewar
1997-07-21  0:00             ` Robert Dewar
1997-07-22  0:00   ` Jakob Heinemann
1997-07-23  0:00     ` Robert Dewar
replies disabled

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