From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1257 invoked by alias); 7 Nov 2008 11:04:27 -0000 Received: (qmail 1074 invoked by uid 22791); 7 Nov 2008 11:04:24 -0000 X-Spam-Check-By: sourceware.org Received: from cp-out2.libero.it (HELO cp-out2.libero.it) (212.52.84.102) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Nov 2008 11:03:43 +0000 Received: from libero.it (192.168.17.3) by cp-out2.libero.it (8.5.016.1) id 4912C7CE001EAD5A; Fri, 7 Nov 2008 12:03:21 +0100 Date: Fri, 07 Nov 2008 11:04:00 -0000 Message-Id: Subject: Re: [GCJ] Performance of GUI applications on embedded systems MIME-Version: 1.0 X-Sensitivity: 3 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable From: "ffileppo" To: "aph" Cc: "java" , "classpath" X-XaM3-API-Version: 4.3 (R1) (B3pl25) X-SenderIP: 130.192.86.37 X-IsSubscribed: yes 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-11/txt/msg00029.txt.bz2 > >> Here's one improvement. If you can get rid of the places in the GTK p= eers > >> where class and method lookups are performed at runtime you'll probably > >> have a fix. This shouldn't be a massive amount of work, just rather > >> boring. > >> > >> In gcj, > >> > >> * Compiled java code is quite fast. > >> * Class lookup by name is slow. > >> * Calling JNI code from compiled java code is quite fast. > >> * Calling compiled java code from JNI code is slow. > >> * Exceptions are slow. > > > I'm testing your patch on my embedded system and now I can see that GUI= performance are very much better (particularly during application startup). > > > > Thank you so much! > > > > However running my test case (please see my first post) I see that CPU = usage is always at 100% (after the application is running), > > so the responsiveness is still not very good. > > What do you expect? You're setting up a Timer with a delay of > 0 milliseconds between events, and it's running continuously. > > Andrew. > You're right. However I'm experiencing slowness when testing some other GUI sample applic= ation (e.g. the test case attached at the end). In this particular test case, the application takes a lot of time to startu= p (compared to the same device, running WinCE and CrEme JVM) and during sta= rt up the CPU usage is always at 100%. After startup, I'v also noticed that highlighting and/or clicking a certain= number of times on buttons cause the application to hang and after that th= e CPU usage is always 100%. I'm still trying to get oprofile working on my target device to see what's = going wrong. Thank you, Francesco Test case: import javax.swing.JComponent; import javax.swing.JFrame; import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JPanel; import javax.swing.JTabbedPane; public class GUITest { public static void main(String[] args) { JFrame frame =3D new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JComponent newContentPane =3D new TestUI(); frame.setTitle("TestUI"); newContentPane.setOpaque(true); frame.setContentPane(newContentPane); frame.setBounds(10, 10, 500, 400); frame.setVisible(true); } static class TestUI extends JPanel { long startTime; JPanel createPanel(int start) { JPanel p =3D new JPanel(); p.setLayout(null); for (int i=3D0; i<100; i++) { JButton ltit =3D new JButton("Variable "+(i+start)+": "); long val =3D System.currentTimeMillis() - startTime; JButton lval =3D new JButton(""+val); ltit.setBounds(5, 10+20*i, 150, 15); lval.setBounds(200, 10+20*i, 150, 15); p.add(ltit); p.add(lval); } return p; } TestUI() { super(new BorderLayout()); startTime =3D System.currentTimeMillis(); JTabbedPane p =3D new JTabbedPane(); for (int i=3D0; i<10; i++) { JPanel page1 =3D createPanel(i*100+1); p.add("P"+i, page1); } add(p, BorderLayout.CENTER); } } }