comp.lang.ada
 help / color / mirror / Atom feed
From: Geoff Bull <gbull@acenet.com.au>
Subject: Re: Announcing JGNAT public version 1.0p
Date: 2000/04/08
Date: 2000-04-08T00:00:00+00:00	[thread overview]
Message-ID: <38EEA282.9505926D@acenet.com.au> (raw)
In-Reply-To: 8ckscp$nv7$1@nnrp1.deja.com



hugin777@my-deja.com wrote:
> 
> In article <38ECB0CC.3B2941E2@earthlink.net>,
>   Charles Hixson <charleshixsn@earthlink.net> 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.




  parent reply	other threads:[~2000-04-08  0:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-28  0:00 Announcing JGNAT Professional version 1.0a Robert Dewar
2000-03-31  0:00 ` Announcing JGNAT public version 1.0p Robert Dewar
2000-04-01  0:00   ` John Merryweather Cooper
2000-04-02  0:00     ` Robert Dewar
2000-04-02  0:00       ` John Merryweather Cooper
2000-04-03  0:00         ` Robert Dewar
2000-04-02  0:00           ` John Merryweather Cooper
2000-04-03  0:00             ` Robert Dewar
2000-04-03  0:00             ` Robert Dewar
2000-04-04  0:00               ` Charles Hixson
2000-04-05  0:00                 ` Geoff Bull
2000-04-05  0:00                 ` David Botton
2000-04-06  0:00                   ` Charles Hixson
2000-04-07  0:00                     ` hugin777
2000-04-07  0:00                       ` Pascal Obry
2000-04-07  0:00                       ` Robert Dewar
2000-04-07  0:00                         ` Ted Dennison
2000-04-08  0:00                           ` Geoff Bull
2000-04-08  0:00                         ` hugin777
2000-04-09  0:00                           ` Optimizing flags Was: " Ken O. Burtch
2000-04-08  0:00                         ` Geoff Bull
2000-04-08  0:00                       ` Geoff Bull [this message]
2000-04-10  0:00                       ` Pascal Obry
2000-04-10  0:00                         ` hugin777
2000-04-10  0:00                           ` Al Christians
2000-04-10  0:00                           ` David Starner
2000-04-11  0:00                             ` Brian Rogoff
2000-04-11  0:00                               ` David Starner
2000-04-11  0:00                               ` Tucker Taft
2000-04-11  0:00                                 ` Brian Rogoff
2000-04-11  0:00                           ` Pascal Obry
2000-04-12  0:00                           ` Pascal Obry
2000-04-07  0:00                     ` Geoff Bull
2000-04-04  0:00               ` JGNAT help puh-leeze G
2000-04-04  0:00                 ` Geoff Bull
2000-04-06  0:00                   ` G
2000-04-06  0:00                     ` Geoff Bull
2000-04-04  0:00           ` Announcing JGNAT public version 1.0p ada_95
replies disabled

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