Software Archive
Read-only legacy content
17061 Discussions

Modifying thread affinity to improve performance

Nils_S_
Beginner
568 Views

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

0 Kudos
6 Replies
JLuna5
New Contributor I
568 Views

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!

0 Kudos
Alexander_W_Intel
568 Views

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

0 Kudos
Alexander_W_Intel
568 Views

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

0 Kudos
Nils_S_
Beginner
568 Views

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

0 Kudos
Alexander_W_Intel
568 Views

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

0 Kudos
JLuna5
New Contributor I
568 Views

Hi Alexander, You could do what you wanted?

0 Kudos
Reply