In profiling an iOS game on an iPhone 3G, instruments is reporting that the system call pthread_setspecific (which is being called from many seemingly unrelated locations) is the biggest CPU bottleneck. Google tells me this deals with storing meta data for threads, however I'm not sure how to track this down since the entire engine is a single thread. Does this have to do with CADisplayLink? Can I optimize specific scenarios to better account for this?
Here's some relevant information that may be helpful in answering my questions:
- Device: iPhone 3G
- iOS version: 4.2.1
- Game-code is entirely C++, with application layer in obj-C.
- The game uses OpenglES1.1
- Unfortunately both RTTI and C++ exceptions are both required and thus enabled.
- This is running a release build (with debug symbols) through the CoreAnimation profiler in instruments.