views:

21

answers:

0

Hi guys,

I'm currently working on a iPhone STG. I developed the system based on a 2D graphic engine developed by other engineers. Both are based on C++.

The game run extremely slow on 3GS(about 5~10 fps). I tried 2 version of iOS: 4.1 and 3.1.2, both very slow. But when I installed the game on an iPhone (yes only "iPhone". Not 3G. Not 3GS), it was smooth and ran without any problem. (15~30 fps)

I first tried to calculate clock ticks used inside the game, and I found out that although fps is only 5~10, the clock ticks I used was 10k-30k, which convert to 0.01~0.03 seconds per frame. It should run at 30 fps if only judging on the clock ticks consumes!

So I thought the problem might be in Object-C part. I then decided to use Instruments and Shark to find out why. The result is very wierd. __longcpy consume over 50% of running time like the screenshot below: screenshot

This screenshot is taken when I run the game on iPhone simulator. I don't know how to use Shark or Instruments with real iPhone :(

I tried Google longcpy but found nothing. I didn't use any memcpy in my code. The engine, as far as I can tell, didn't use much memcpy, either.

The problem is: what is that means by __longcpy consume over 50% of running time? Does it means that the engine use lots of memcpy, or I accidently move memory around in 3GS? From what it reads, __longcpy belongs to some mysterious "thread_start", what does it means? Or is there any other solution I can try?

I'll post code if it's needed to validate the problem. But I really can't understand where the problem is, and the code is very huge...

Thanks for helping!