Performance problems with bitmaphandling on mac (only)

Questions about Wine on macOS.
Locked
mattsbg
Level 1
Level 1
Posts: 5
Joined: Sun Nov 28, 2010 7:04 am

Performance problems with bitmaphandling on mac (only)

Post by mattsbg »

Hello,

i am trying to get an application to run on mac. It already runs fine on linux (ubuntu and freebsd), but on mac I've severe performance issues using bitmaps. I tracked it down that it has something to do with hbitmap using the api for creating a 10 mega pixel image and saving as a bitmap file.

On windows this takes about 1.400 ms, on ubuntu 2.000 ms but on mac approximatly 30.000 (with 100% CPU usage). I already did researches in the newsgroups and assume that there are conversions taking place. If I change the bit depth to 16 I can reduce the time to approx. 8.000 ms on mac also.

I know that there's a project of a DIB Engine. But as it seems (studying other posts), its not compatible with mac os yet?

Conditions:
- I can change the source code of the app as it is an company internal app written in Delphi
- its not possible to change to 16bit bitmaps in the application as it is an imaging application
- its not possible using a GDI+ library instead, because there would be too much changes


Any ideas would be greatly appreciated as I got stucked at this point.

thanks,
Matthias
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

what version of Mac OS X? What version of X11... if your using Apple's default X11, you shouldn't be, its pretty buggy.

Xquartz builds are much better.
http://xquartz.macosforge.org/
mattsbg
Level 1
Level 1
Posts: 5
Joined: Sun Nov 28, 2010 7:04 am

Post by mattsbg »

its the snow leopard, X11 XQuartz 2.3.6 and xorg-Server 1.4.2.

But actually it is the default - didn't update yet.
Thunderbird
Level 5
Level 5
Posts: 336
Joined: Mon Nov 24, 2008 8:10 am

Post by Thunderbird »

The best thing to do is really to get the bitmaps converted to 24-bit. Even doing that once at runtime won't be bad.

In short all generic bitmap code ('DIB stuff') is delegated to X11. The problem is that in general X11 needs to have the bitmaps at the same color depth X is running at. We perform software conversion back and forth but this can be bad.

These days conversion is not always needed anymore when XRender is around, but I doubt XRender is hardware accelerated right now in XQuartz but still it should be better than the classic conversion things we are doing.
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

mattsbg wrote:its the snow leopard, X11 XQuartz 2.3.6 and xorg-Server 1.4.2.

But actually it is the default - didn't update yet.
not sure it'll help, but you should try in a newer version. Xquartz no longer replaces Apple's version, it stays intact... you can try it without messing anything up. The latest version has much improvements... I do not know if it will help your situation at all, but many things in Wine work much better than with Apple's stock versions.
mattsbg
Level 1
Level 1
Posts: 5
Joined: Sun Nov 28, 2010 7:04 am

Post by mattsbg »

@Thunderbird: yes, I think my problems are the forth and back conversions. Also pointing in this direction is, that if I try it with 16 bit it is way faster.

Do I have to install X-Render separatly? Would it help in my situation?

Any other ideas how I can influence the conversions?
mattsbg
Level 1
Level 1
Posts: 5
Joined: Sun Nov 28, 2010 7:04 am

Post by mattsbg »

I also installed the latest xquartz now. But sadly it doesn't change the situation for me.

Is there a easy way to change the resolution of the X-Server? Any negative side effects to expect from this?
mattsbg
Level 1
Level 1
Posts: 5
Joined: Sun Nov 28, 2010 7:04 am

Post by mattsbg »

after doing more investigations I found out, that the problem does not occur in Crossover. Performance is really great with their version, despite the fact that I have a new problem there with rendering richedits 2 bitmaps (i didn't have time to track this down yet).

Any ideas whats working different here? Of course crossover would be an alternative for me if I get the richtext rendering to work.

thanks,
Matt
doh123
Level 8
Level 8
Posts: 1227
Joined: Tue Jul 14, 2009 1:21 pm

Post by doh123 »

mattsbg wrote:after doing more investigations I found out, that the problem does not occur in Crossover. Performance is really great with their version, despite the fact that I have a new problem there with rendering richedits 2 bitmaps (i didn't have time to track this down yet).

Any ideas whats working different here? Of course crossover would be an alternative for me if I get the richtext rendering to work.

thanks,
Matt
Crossover uses a customized Wine version, plus their own total closed source xorg X11 server.. and nothing close to what Apple or Xquartz does.
Locked