Summary: | GC.drawImage is slow on Linux for large images | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] Platform | Reporter: | Mark Siegel <mark.siegel> | ||||||
Component: | SWT | Assignee: | Felipe Heidrich <eclipse.felipe> | ||||||
Status: | RESOLVED WORKSFORME | QA Contact: | |||||||
Severity: | normal | ||||||||
Priority: | P3 | CC: | dbennett, gheorghe, Silenio_Quarti, steven.wasleski, steve_northover | ||||||
Version: | 3.2 | Keywords: | performance | ||||||
Target Milestone: | --- | ||||||||
Hardware: | PC | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Attachments: |
|
Description
Mark Siegel
2006-05-23 18:46:15 EDT
Created attachment 42786 [details]
test case
Hmm, I wrote a test case to reproduce this problem, not sure if it really captures the problem you are having. But the results are interesting.
On Windows, as the region increases the time to redraw also increases.
count: 200 rect: Rectangle {10, 10, 100, 100} time: 359
count: 200 rect: Rectangle {10, 10, 200, 200} time: 438
count: 200 rect: Rectangle {10, 10, 500, 500} time: 859
count: 200 rect: Rectangle {0, 0, 1000, 1000} time: 2453
I hope I doing a Billy but the number I'm getting on GTK don't make any sense: count: 200 rect: Rectangle {10, 10, 100, 100} time: 1881 count: 200 rect: Rectangle {10, 10, 200, 200} time: 7029 count: 200 rect: Rectangle {10, 10, 500, 500} time: 228 count: 200 rect: Rectangle {0, 0, 1000, 1000} time: 1022 Carbon numbers: count: 200 rect: Rectangle {10, 10, 100, 100} time: 53 count: 200 rect: Rectangle {10, 10, 200, 200} time: 82 count: 200 rect: Rectangle {10, 10, 500, 500} time: 428 count: 200 rect: Rectangle {0, 0, 1000, 1000} time: 2069 ---- SSQ, do you know what is wrong with GTK ? We will investigate for 3.2.1. Can you please retest this problem ? We had some major changes in GC (see Bug134760). I run my snippet again and I got different numbers: count: 200 rect: Rectangle {10, 10, 100, 100} time: 106 count: 200 rect: Rectangle {10, 10, 200, 200} time: 222 count: 200 rect: Rectangle {10, 10, 500, 500} time: 1131 count: 200 rect: Rectangle {0, 0, 1000, 1000} time: 4136 NOTE: The changes are major so it is unlikely that we will back port them to 3.2.1. However, it is useful to know if the situation is better in the 3.3 stream. This bug report is a bit confusing. Felipe wrote a benchmark, hoping that it captured what was happening in the GEF code. We need to be sure of this by recreating the initial bug using GEF. Mark please attach 'purple.bmp' and assist us if we have any problems recreating the problem in GEF (we will ask for help). Hopefully, Felipe's code is capturing the same problem. Meanwhile, we will investigate Felipe's code. I can no longer reproduce the GTK numbers in comment #2 (my machine have been in a funny state). The new GTK numbers are in comment #5. These numbers show that when the clipping is increased, image drawing gets slower on all platforms. NOTE: The hardware is different between Windows, GTK and carbon so it doesn't make sense to compare the raw image drawing times (ie. Windows is not necessarily faster). I no longer believe that my test case captures the problem. We need a real test case from Mark (like Steve says). We won't change code for 3.2.1 without a repeatable test case. I agree. We won't fix this for 3.2.1 without a better test case. David, can your team provide a better test case? Created attachment 48499 [details]
Reproduction image
Attached is the image file 'purple.bmp' I used to originally reproduce the problem.
It may take a while to set up my Linux box again, but I can try to get an SWT repro app together.
Okay, I load these plugins into my workspace: org.eclipse.draw2d [R32_Maintenance] org.eclipse.gef [R32_Maintenance] org.eclipse.gef.examples.shapes [R32_Maintenance] org.eclipse.swt [R_3_2_maintenance] org.eclipse.swt.gtk.linux.x86 [R_3_2_maintenance] I replaced ShapesEditPart.createFigureForModel with the code from comment 0. Run Eclipse (self-host). 1) New->Example...->Shapes Diagram 2) In the Diagram, create a Rectangle (it draws purple). 3) Drag and resize it around. I see no problem. What am I doing wrong ? I also test this on Windows, same behaviour. Note: when I resize or drag the figure it only draws a 'shade' of the figure. My linux hardware is: IBM IntelliStation Z Pro with 2 Intel Xeon CPU 2.66GHz, 1536Mb memory nvidia video card. Running FC 5, -sh-3.1$ rpm -q gtk2 glib2 pango atk xorg-x11-server-Xorg gtk2-2.8.17-1.fc5.1 glib2-2.10.2-1.fc5.1 pango-1.12.1-1.fc5.1 atk-1.11.4-1.fc5.1 xorg-x11-server-Xorg-1.0.1-9.fc5 David, can you or your team provide a recreatable test case? Time is running out for 3.2.1. Sorry, time ran out and without a repeatable test case we can't proceed. |