Inside SWT

Tuesday, May 22, 2007

I hate Windows

Ok, now I have your attention: I don't really hate Windows (any more than the rest of them). So what did Windows do to me this time you ask? We were looking good for Eclipse 3.3 RC2 when this came in.

On Vista only (win32, not WPF) , it turns out that TVM_GETNEXTITEM is really slow when called with TVGN_LASTVISIBLE during a tree item collapse when the item that is collapsing has more than 23 children and each child has at least one child and the collapsing item that started the whole thing going is about to become the new absolute last item in the tree. All this has to happen during a WM_NOTIFY for custom draw (NM_CUSTOMDRAW with subcode CDDS_POSTPAINT) or it's not slow. You got all that?

Obviously, we have a broken fuxit .... as in, "What the fuxit doing?". My guess is that some cache way down deep in Windows is getting invalidated and someone is linear searching every item in the tree multiple times.

Fortunately, SWT has no custom C code (yay!) so it was pretty easy to find the system call that was taking the time and come up with a work around. Even though the work around code will run on XP, I'll probably guard it with a test for Vista. After all, we're closing in on RC2. Gotta be careful.

Steve

3 Comments:

  • Thank you for handling all those nasty cross platform issues, so we don't have to and simply can use SWT. Honestly.

    By Blogger Marko Schulz, at 2:40 AM  

  • goddam if this is a sample of the kind of problems you stumble upon, I cannot imagine the headaches you must have had while writing SWT!

    Thank you!

    By Anonymous Anonymous, at 11:07 PM  

  • Thank you for letting us know the issues

    By Blogger justcook, at 7:10 AM  

Post a Comment

<< Home