From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32220 invoked by alias); 10 Aug 2008 21:34:49 -0000 Received: (qmail 32211 invoked by uid 22791); 10 Aug 2008 21:34:49 -0000 X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 10 Aug 2008 21:33:56 +0000 Received: by fg-out-1718.google.com with SMTP id e21so897031fga.28 for ; Sun, 10 Aug 2008 14:33:53 -0700 (PDT) Received: by 10.86.63.19 with SMTP id l19mr6797618fga.60.1218404033151; Sun, 10 Aug 2008 14:33:53 -0700 (PDT) Received: from ?192.168.0.21? ( [88.162.37.242]) by mx.google.com with ESMTPS id l19sm1698361fgb.7.2008.08.10.14.33.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 10 Aug 2008 14:33:52 -0700 (PDT) Message-ID: <489F5EBC.1060300@laposte.net> Date: Sun, 10 Aug 2008 21:34:00 -0000 User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: ffileppo CC: java Subject: Re: Performances with gcj References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit From: Benjamin de Dardel Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2008-08/txt/msg00014.txt.bz2 Hi Francesco, Thanks for your response. I had already tryed to optimize the code with the java file, but it didn't work : $ gcj -0 --main=PipeTest -o test.bin PipeTest.java gcj: unrecognized option '-0' With class files, compilation works... but performances decrease ! May be it's beacause of the threads. I don't know. I'll do some other tests in the next days. # test5 $ gcj -C PipeTest.java $ gcj -O2 --main=PipeTest -o test.bin PipeTest.class Consumer.class Producer.class Filter.class real 21m59.844s user 5m26.070s sys 9m52.130s # test6 $ gcj -C PipeTest.java $ gcj -O3 --main=PipeTest -o test.bin PipeTest.class Consumer.class Producer.class Filter.class real 25m34.394s user 6m12.250s sys 11m4.440s ffileppo a écrit : >> 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 > > > > >