public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: "ffileppo" <ffileppo@libero.it>
To: "benjamin\.de-dardel" <benjamin.de-dardel@laposte.net>
Cc: "java" <java@gcc.gnu.org>
Subject: Re:Performances with gcj
Date: Sun, 10 Aug 2008 18:30:00 -0000	[thread overview]
Message-ID: <K5EE0Q$D2341C522B2A4AED30A319DD6268ED66@libero.it> (raw)

> Hi all,
>
> I had to release a program that executes an external process and gets
> its standard output.
> I implemented a solution with threads and pipes to redirect inputs and 
> outputs (cf PipeTest.java).
>
> I choose the 'find /' command to test it.
> I'm very surprised about gcj performances which are 5x slowly than sun jvm.
> In fact, I expected that my compiled program would be faster than all jvm.
>
> Do you have an idea about these differences ?
> Is that the gnu classpath implementation which is quiet slow ?
>
> Regards,
> Benjamin
>
> # test1 : bash
> $ time find /
> real    2m6.054s
> user    0m5.260s
> sys     0m6.990s
>
> # test2 : compilation with gcj
> $ gcj --main=PipeTest -o test.bin PipeTest.java
> $ time test.bin
> real    18m50.632s
> user    4m56.380s
> sys     8m31.940s
>
> real    19m38.148s
> user    5m9.660s
> sys     9m44.710s
>
> # test3: interpretation with gij
> $ gcj -C PipeTest.java
> $ time gij PipeTest
>
> real    22m39.882s
> user    6m7.580s
> sys     10m26.350s
>
> # test4 : interpretation with java
> $ javac PipeTest.java
> $ time java PipeTest
> real    3m35.035s
> user    1m18.710s
> sys     0m11.730s
>
> ##### compilers #####
> $ gcj --version
> gcj (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu6)
>
> $ javac -version
> javac 1.6.0_03
>

You need to pass -O2 or -O3 option to gcj compiler (no optimization is enabled by default).
Please take a look at other posts about gcj performance (http://gcc.gnu.org/ml/java/2008-05/msg00017.html).

Francesco


             reply	other threads:[~2008-08-10 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-10 18:30 ffileppo [this message]
2008-08-10 21:34 ` Performances " Benjamin de Dardel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='K5EE0Q$D2341C522B2A4AED30A319DD6268ED66@libero.it' \
    --to=ffileppo@libero.it \
    --cc=benjamin.de-dardel@laposte.net \
    --cc=java@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).