I want repaint() acceleration on OS X :)

I know, it’s not the first time I am adressing this subject… On OS X, wether it is PPC or Intel, the repainting in JUCE takes too much time. In my app, I have 2 Wave Displays, and they get updated (=repainted) every 20ms. The painting itself does not take much time, it is the blitting by the OS that takes much time.

I know Jules said that this had something to do with the fact that Juce switched to using HIViews some time ago. But, is there no way to accelerate this? Believe it or not, but on my IBook G4, 50% of the total CPU power are used to render the 2 Wave Displays! It’s insane! And it’s not the code in paint() that is eating up all the CPU, it’s what’s done afterwards that eats the CPU. Even on my Intel Mac, it’s still 20%-25%. Way too much.

On the same Intel Mac, it takes perhaps 5% when using Windows, absolutely nothing compared to the OS X version.

So, has anyone got some clever idea how I can speed up things a little bit? I am not familiar with how OS X works, so I don’t know where to start at exactly…

Same numbers here.
I’m afraid I have to fully agree with you.

As I’ve mentioned elsewhere, I’ll shortly be rewriting all the mac code to use Cocoa instead of Carbon, so all the current blitting/windowing code will be ditched. Hopefully Cocoa will work better anyway, but there’s certainly no point spending time worrying about the old implementation now.

What I don’t understand is, that apart from OS X’s slow blitting, the painting itself also seems to consume considerably more (300% more) time than on Windows (on the same machine). Could it be that the code produced by GCC is really that slow (I use XCode 2.4.1) ?

There are one or two places on win32 where I used MMX to speed it up. Don’t think I ever got round to making that run on the mac, but it could be done. It’d be unlikely to make 300% difference though, unless you’re only doing the particular operations that are accelerated.

Hmm I tested it with Graphics::clearAll() and Graphics::drawVerticalLine() only. It’s really strange. Yes, one would not expect such a big performance difference on the same machine… Maybe, the way that Windows and Mac measure the performance are different, too? I just looked a the performance in the Task Manager and the Activity Monitor, but still it’s such a big difference that there is something going on…