From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26219 invoked by alias); 7 Nov 2008 11:18:16 -0000 Received: (qmail 26146 invoked by uid 22791); 7 Nov 2008 11:18:15 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 07 Nov 2008 11:17:39 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id mA7BHaGt000776; Fri, 7 Nov 2008 06:17:36 -0500 Received: from zebedee.pink (vpn-12-72.rdu.redhat.com [10.11.12.72]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mA7BHYqY032194; Fri, 7 Nov 2008 06:17:34 -0500 Message-ID: <491423CE.8050704@redhat.com> Date: Fri, 07 Nov 2008 11:18:00 -0000 From: Andrew Haley User-Agent: Thunderbird 2.0.0.17 (X11/20080914) MIME-Version: 1.0 To: ffileppo CC: java , classpath Subject: Re: [GCJ] Performance of GUI applications on embedded systems References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg00030.txt.bz2 ffileppo wrote: > However I'm experiencing slowness when testing some other GUI sample application (e.g. the test case attached at the end). > > In this particular test case, the application takes a lot of time to startup (compared to the same device, running WinCE and CrEme JVM) and during start 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 the CPU usage is always 100%. > > I'm still trying to get oprofile working on my target device to see what's going wrong. Well, it doesn't have to run on the target device. It was easy for me to duplicate your previous problem on my desktop machine with gcj and oprofile. There's nothing to stop you doing the same. Andrew. > 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 = new JFrame(); > frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); > JComponent newContentPane = 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 = new JPanel(); > p.setLayout(null); > > for (int i=0; i<100; i++) { > JButton ltit = new JButton("Variable "+(i+start)+": "); > long val = System.currentTimeMillis() - startTime; > JButton lval = 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 = System.currentTimeMillis(); > JTabbedPane p = new JTabbedPane(); > > for (int i=0; i<10; i++) { > JPanel page1 = createPanel(i*100+1); > p.add("P"+i, page1); > } > > add(p, BorderLayout.CENTER); > } > } > > } >