I just purchased a new G5 iMac so I pulled an old project that I had been working on some years ago. A large portion of the cpu time in the code goes to blitting the screen. After experimenting a bit I discovered the performance to be VERY poor. I created a test application that simply creates an offscreen GWorld, paints it red and blits it to the screen a hundred times. I'm getting a throughput of around 140Mbytes/sec. What is going on? here is the snippet (copybits is even slower)
GWorldPtr offscreenGW = NULL;
Rect r = {0,0,900,1440};
Ptr screenBase = (*((*GetMainDevice())->gdPMap))->baseAddr;
Ptr offscreenBase;
//the screen resolution 1440x900x32bit
UInt32 bytes = 900*1440*4;
NewGWorld(&offscreenGW, 32, &r, 0,0,0);
SetGWorld(offscreenGW, NULL);
ForeColor(redColor);
PaintRect(&r);
//get base address of the offscreen GWorld
offscreenBase = GetPixBaseAddr(GetGWorldPixMap(offscreenGW));
for (int i=0;i<kNumBlits;i++){
memcpy(screenBase, offscreenBase, bytes);
}
any suggestions would be very much appreciated
