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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,13c7ec19f3c43155 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: speed of generic code in Ada (vs Java) Date: Wed, 21 May 2008 11:41:52 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <9e9bdae7-5e91-4e0c-b783-1ed72311a733@t12g2000prg.googlegroups.com> <2e1de55a-69e5-439e-addc-bde650b4c16a@i36g2000prf.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1211384512 30954 192.74.137.71 (21 May 2008 15:41:52 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 21 May 2008 15:41:52 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:eMWpNlg8JymIVrIijTqZw5fTf6A= Xref: g2news1.google.com comp.lang.ada:279 Date: 2008-05-21T11:41:52-04:00 List-Id: Graham writes: > In any case, the 5x comparison sounds extreme and probably comes from > comparing arrays of ints with something from the Java Collection > classes, which is a bit like comparing Ada arrays with Ada Containers. I don't see why. Ada.Containers.Vectors, for example, does not introduce an extra level of indirection for each component of the vector. Ada is more like C++ in that regard. > Alternatively, if you defined an Integer_Class in Ada with operators > that allowed it to be used in assigments, I imagine you'd see similar > performance hits to Java's autoboxing. Right. One problem with Java is that in many cases it forces you to have an extra level of indirection when you don't want it. - Bob