[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: GCJ and C/C++ applications how is it possible ?



On Thu, May 23, 2002 at 07:15:34PM +0200, Pac wrote:
| why ?

Layers upon layers upon layers of indirection.  The JVM interprets
java bytecode.  It then delegates the "native" methods to some C code
(from the java-gnome project).  Those C/C++ functions then invoke some
other C/C++ functions and so on.  Each has overhead.  Then you have
your callbacks.  In Java "callbacks" are always wrapped in classes
(java is not OO, it is Class-O).  When you pass a callback to the
java-gnome stuff it must do the necessary wrapping/unwrapping to
provide a C-level function pointer to the underlying GTK+ system and
marshall arguments back and forth.  More overhead.  The java-gnome
package must also keep track of all GTK+ widgets it creates so that
when the JVM's GC decides it is time to free it it can.  That's more
overhead in storing references.

| the point is that evas provides hardware acceleration capabilities.

Java and hardware acceleration don't mix real well.  One of java's
design goals was to remove all system-level functionality from you.
It goes so far as to provide only the lowest common denominator wrt
system functionality.

| But evas you should Xlib function create a window to put an evas
| canvas into it.

Ok.

| I was wondering if a new GTK component were made to encapsulated the
| Xlib call and be able to communicate with evas library.

I don't know, you might be the first.

In general there are two opposing styles of development :
    o   high-performance
    o   high-level (portable, maintainable, etc)

They are opposing because high-level constructs have layers of
indirection to provide the high-level-ness.  High-performance stuff is
naturally close to the hardware and the bits themselves and don't have
the layers of indirection to get in the way of performance.  In the
right environment and non-extreme circumstances the two can be merged
(after profiling!) to build a snappy application.

I've worked with java enough to know that you're not going to get
high-performance out of it.  Swing is a dog.  AWT it too limited.
Everything else is less mature and adds more layers of indirection.
On top of that, none of the JVMs I've used had really decent
(performance-wise) garbage collectors.  I haven't tried Sun's jdk 1.4
yet (is it even out of beta?) though.

HTH,
-D

-- 

A man of many companions may come to ruin,
but there is a friend that sticks closer than a brother.
        Proverbs 18:24
 
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg

Attachment: pgpCVBxxlW9ts.pgp
Description: PGP signature


Reply to: