It seems like the multi-core revolution is here. Not just all around us, but even in our very own blog community. Recently, two posts by my colleagues discussed multi-cores: Ofer Goren, guest posting on Code of Contact, about his share of optimizations done for a multi-core platform for our SIP Stack, and Sagee discussing the utilization of multi-core processors for video coding.
As Sagee puts it:
Designing and writing “great code” is the ultimate goal for every software developer. However, for us “performance chasers”, “great code” is not about maintaining code convention or cross-platform compatibility. It is squeezing the most from our processor, and so code optimization becomes a great part of our work, whether we like it or not.
I’ll put it in simpler terms: if you need video coding in your application, you will have to optimize it specifically for the hardware you use. And doing that means writing the code in the lowest level possible to get the most out of the processor.
Just Remember Atwood
So how do multi-core and optimization live with Jeff Atwood’s law? I guess that if by “application” he/we don’t necessarily mean “the entire application”, they can co-exist beautifully.
I strongly believe we should not over optimize. However, when it comes to VoIP products, there are two specific areas where we have no choice:
- Codec implementation – codecs are CPU intensive. They are usually “easy” to optimize on multi-core platforms, simply because they have to go over massive amounts of data, which often can be decoupled and/or parallelized. Audio codecs are easier than video – video is just plain difficult – but still hand optimizing codecs for specific chipsets is how our industry works these days.
- Communication – communication is hard as it is, the hardest part being the fact that it relies on system calls to the operating system and interaction with network drivers, which you usually have little control over. When developing servers, the ability to optimize the communication segments for a multi-core platform can make a huge difference.