Bug 53443 - Native image loading
Summary: Native image loading
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Carolyn MacLeod CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
: 4614 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-01 16:28 EST by Lynne Kues CLA
Modified: 2019-09-04 03:00 EDT (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lynne Kues CLA 2004-03-01 16:28:17 EST
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.
Comment 1 Grant Gayed CLA 2004-03-02 13:19:13 EST
CC to look into this.
Comment 2 David Whiteman CLA 2004-05-14 15:22:02 EDT
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.
Comment 3 gkukies CLA 2004-05-17 02:21:48 EDT
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.

Comment 4 Stef van Dijk CLA 2004-05-17 10:18:56 EDT
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?
Comment 5 David Whiteman CLA 2004-05-17 10:27:25 EDT
Guenther, adding you to the cc: list since there is a question in the bug 
report directed to you.
Comment 6 gkukies CLA 2004-05-17 10:53:40 EDT
Both code snippets are slow SWT and AWT. AWT is about 200 ms slower than SWT 
and SWT needs about 10 sec.
Comment 7 Christophe Cornu CLA 2004-05-18 13:25:53 EDT
Are you using the j9 jit? I was told this plaform has a jit.
Comment 8 gkukies CLA 2004-05-19 02:19:28 EDT
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.
Comment 9 Billy Biggs CLA 2005-04-29 22:19:14 EDT
This should probably be marked as a duplicate of bug 4614.
Comment 10 Silenio Quarti CLA 2005-08-22 23:29:40 EDT
*** Bug 4614 has been marked as a duplicate of this bug. ***
Comment 11 Carolyn MacLeod CLA 2006-02-03 12:47:57 EST
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.
Comment 12 Lars Vogel CLA 2019-09-04 03:00:56 EDT
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.

--