Interpreting Multicore Performance Trace (Eclipse/Android)

后端 未结 2 796
后悔当初
后悔当初 2020-12-30 02:37

I\'m working on an android game, and I started noticing a little sluggishness during development so I wanted to try to utilize multithreading for fun and learning.

2条回答
  •  爱一瞬间的悲伤
    2020-12-30 02:55

    Thanks for the question. A full answer by an insider will be helpful to me, too. I'll say what I know.

    • Some (all?) phones have an option to enable/disable the second core. Have you checked that yours is turned on?

    • In my own app I've noticed that merely going from one thread to two (on one core) with no change in total work done causes a factor of 1.5 slowdown, so clearly threading itself has a cost.

    • It's been in the news that Intel is calling Google out on poor implementation of multicore threading:

      http://www.pcworld.com/article/257307/dual_core_processors_wasted_on_android_intel_claims.html

      Your results validate this.

    • One other thing to bear in mind is that multi-core is not multi-processor. You're sharing cache and memory controller bandwidth between cores. One can stall while it waits for the other to finish with a shared resource, in particular for writes on shared cache lines. However this effect ought not account for the single-threading you are seeing.

提交回复
热议问题