Modifying thread affinity to improve performance

Modifying thread affinity to improve performance

Hello,

I have a math-intensive Android application here that does realtime audio generation. I generates sound data and this process is difficult if not impossible to modify to support multithreading.

The test system is a dual core Atom SoC with hyperthreading.

The problem that I'm facing is that the android scheduler keeps moving my thread around on multiple cores and the performance could be much better. I get a huge performance boost when I set the affinity of the thread to a single core.

Would you recommend to do it that way on mobile devices or is this a "no go"?

Thank you,

Nils

7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi, it's very interesting, I don't know how you can make this, but I right now know is that your idea is amazing and nice!

Nils,

really interesting question. I don't think setting the CPU affinity is a No-Go, but it might impact the battery lifetime. If you have a noticeably better performance I would set the affinity but revise this for future CPUs and Android versions that are released. 

Hope this helps,
Alex

Hi Nils,

The Silvermont Core (e.g. Baytrail) doesn't use Hyperthreading. So setting the affinity to 2 cores would just work for the privious hardware generation. 

BTW: pretty good CPI rate. 

Thanks,
Alex

Hello Alex,

glad you mentioned it, I didn't think of that.

I really hope that the Bay Trail SoCs can keep up with the Clover Trail+ SoCs although the clock rate is lower. According to wikipedia, the lowest clock rate is 1,33ghz, compared to my test device with 1,6ghz this is a little bit lower. Hopefully out-of-order execution will make me happy :)

Thank you,

Nils

Hi Nils,

Bay Trail does support additional Burst Modes compared to Clovertrail+. So your single threaded application should actually run on a higher clockspeed than 1.6GHz. 

Alex

Hi Alexander, You could do what you wanted?

Leave a Comment

Please sign in to add a comment. Not a member? Join today