Community
Participate
Working Groups
I have a piece of code that my initial timing tests show as taking over 1.5 seconds on a Mac (OK an admittedly old, slooow mac but 1,500 msec?). The code creates a shell and copies the parent shell's bits into a new image (sort of a poor man's double buffer). It seems to be the 'copyArea' that's taking the time... Snippet coming... Note: I haven't tried this snippet on the offending machine yet but it's a copy of the code that was giving problems. I'll give it a go tomorrow.
Created attachment 49560 [details] SWT Snippet showing a startup issue Warning: You have to hit the 'ESC' to close the window (there's a 'no trim' shell overlapping the original shell)...
Here is the times to run on my Mac dual 1.25 Ghz G4 PowerPC. Start: Shell Create: 16 Image Create: 9 GC Create: 1 Copy Area: 974 Dispose: 0 Set Visible: 40 Update: 0 Done: 1040
Fixed > 20060929 Please try the latest. The time went down to about 200ms on my machine and Felipe's intel mac.
Thanks Selenio, I'll give it a try... I'm presuming the times you listed were -before- the fix; what are the new times??
The fix only affects the "copyArea" time and it is about 200ms (instead of 974) on my machine now.
Is this a Mac-only fix or might it help other platforms as well?
Mac only. I have not looked at the other platforms. Do you see any performance problems in any other platform?
Short answer...yes...;-(. I'm at the point where I think I'll have to re-evaluate my approach. Kim says that even with your patch her performance is still too slow and Boris has similar problems on his XP box. Oh well, it was a good try and I'll come back to it later...thanks for your help (and I might come back later if I come up with another approach. BTW, I'm still surprised that we can't get the bits faster on a Mac; based on my almost complete lack of knowledge I'd thought that Mac's already maintained a backing store for a control and I expected getting a control's (shell's?) bits would be very inexpensive. Is there another (perhaps Mac-specific) API that I could use?
Getting the bits from the shell on Mac should be faster. Note that this testcase is getting bits from the screen.
How would I change the snippet to get the bits from the shell (other than going through its 'display'?
Just create the GC on the Shell instead. Note that you will not be able to copy bits from the trim like that.
Changing OS from Mac OS to Mac OS X as per bug 185991