Performance problems with bitmaphandling on mac (only)
Performance problems with bitmaphandling on mac (only)
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
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
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/
Xquartz builds are much better.
http://xquartz.macosforge.org/
-
- Level 5
- Posts: 336
- Joined: Mon Nov 24, 2008 8:10 am
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.
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.
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 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.
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
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.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