From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e6c9800e35ccfeee X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: GNAT: Performance of String functions Date: 1997/07/18 Message-ID: #1/1 X-Deja-AN: 257576293 References: <33CF3908.3DF62EEE@ericsson.com> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-07-18T00:00:00+00:00 List-Id: Jakob asks <> 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