Community
Participate
Working Groups
v3040 Some profiling of pocket pc code has been done and a lot of time is spent loading images. Using native code to load images has proven to be much faster. For example, Dave Lavin wrote some test cases to compare the time to load a .png file in eSWT vs MIDP-NG. MIDP uses native code to load the same .png image. These results are running on a Windows2000 desktop machine (image size = 240X246) = eswt time 451, midp time 20. Has SWT considered handling image loading natively? Could it be done on a platform by platform basis? As I say at the beginning of the bug report, pocket pc is slowed down due image loading in Java code vs. natively.
CC to look into this.
I would like to add that although eSWT only has an interest in PNG, I would like to see a similar approach taken for GIF and JPEG as well, if it results in large performance improvements.
It needs about 10 sec to create a GIF-Image with 640 x 480 on a Toshiba e800 with j9. Does anyone have the same experience on that. I think it is a bit to slow. These are the Code snippets: byte[] indata = ...; // is a bytearray of png or bmp image data SWT ByteArrayInputStream BAIS = new ByteArrayInputStream(indata); ImageData imdata = new ImageData(BAIS); Image test = new Image(GUI.getDisplay(), imdata); AWT java.awt.Image img = Toolkit.getDefaultToolkit().createImage(indata); MediaTracker mtr = new MediaTracker(new Frame()); mtr.addImage(img,0); try { mtr.waitForAll(); } catch (InterruptedException e) { } Toshiba e800 PocketPC 2003 Version: 4.20.1081 (Build 13100) Intel PX263 XSCALE j9 Target: 20031212b swt-win32-3038.dll All classes from WSDD 5.6 demo I deleted all SWT-classes in ppro-ui-win.zip. So i can use the latest SWT from eclipse. I tried it with the original SWT-Version shipped with WSDD 5.6 and SWT-version 3038,3044 and 3049, but it is still slow.
Just so I'm clear on this, are you saying it's slow using both the SWT and AWT code snippets? They both take roughly 10 seconds to load the image? Or is AWT significantly slower than SWT?
Guenther, adding you to the cc: list since there is a question in the bug report directed to you.
Both code snippets are slow SWT and AWT. AWT is about 200 ms slower than SWT and SWT needs about 10 sec.
Are you using the j9 jit? I was told this plaform has a jit.
I think the jit is on by default, so the only switches I use are "-Xmx128m" and "-jcl:foun". I don't have an idea how to use the other switches to improve the performance.
This should probably be marked as a duplicate of bug 4614.
*** Bug 4614 has been marked as a duplicate of this bug. ***
The constructor: new Image(Device, String); now loads images natively on Windows and GTK. Note that no other Image/ImageData constructor or ImageLoader.load method does this. See bug 24451 comment 51 for details. I am leaving this bug open to one day have another look at the remaining platforms.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it and remove the stalebug whiteboard tag. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. --