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,4a36b7df69d1af90 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: Announcing JGNAT public version 1.0p Date: 2000/04/08 Message-ID: <38EEA282.9505926D@acenet.com.au>#1/1 X-Deja-AN: 608240535 Content-Transfer-Encoding: 7bit References: <8bqd8g$sbs$1@nnrp1.deja.com> <8c2613$hce$1@nnrp1.deja.com> <8c7fh4$25g$1@nnrp1.deja.com> <8c92nl$nqn$1@nnrp1.deja.com> <8cak93$dtl$1@nnrp1.deja.com> <38EA152B.6D7A4481@earthlink.net> <1MNG4.630$n8.195854@news-east.usenetserver.com> <38ECB0CC.3B2941E2@earthlink.net> <8ckscp$nv7$1@nnrp1.deja.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 955163413 203.35.118.1 (Sat, 08 Apr 2000 13:10:13 EST) Organization: Customer of Telstra Big Pond Direct MIME-Version: 1.0 NNTP-Posting-Date: Sat, 08 Apr 2000 13:10:13 EST Newsgroups: comp.lang.ada Date: 2000-04-08T00:00:00+00:00 List-Id: hugin777@my-deja.com wrote: > > In article <38ECB0CC.3B2941E2@earthlink.net>, > Charles Hixson wrote: > > [..] This will let me do the screen designs in Java, where there are > tools around > > and portable libraries that will (almost always) already be installed, > and the > > drive them with an Ada main program that calls the screens to get > information. > > I wonder why you would do that ? Large amount of code already in Ada. Java programs tend to more complicated than Ada programs. low-level system interaction, which can be made reasonably portable. > The problem with Java is the amount of memory consumed by the JVM, not > the speed anymore (again AFAICS). Well I program mainly in Java, not by choice. This claim is plain wrong. Non-trivial java programs require careful design, or they run like a dog. The best I can generally do with Java is half as fast as Ada (that is in a tight loop just calculating with primitive types). > > YMMV of course. These kind of "pseudo benchmarks" are of course not > worth much - but it gets my point through, anyway :-) Well, if what you need to do is calculate primes, then your benchmark would be perfectly reasonable. If you need to model the stock market then your benchmark is irrelevant. I haven't tried your test, but your program is small enough to be able to neatly avoid what is perhaps the worst feature of Java - that all forms of abstraction are heap allocated. The way I reduce this problem in Java is to reuse objects, rather than leaving them to the GC - but that removes one of the supposed benefits of Java. There are other performance gotchas too. Take the Java containers - they contain "generic" objects. When you extract an object you have to cast it back to its actual type, this involves a run time tag check - in practice I have profiled code where this check this check has huge impact. Ada's generics avoids this type of problem all together. Java won't let you turn off any checks to gain speed (which is reasonable for applets, but not for applications). Cheers Geoff If you are finding that Java is a lot faster than native Ada you have definitely done something wrong.