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
Atwood’s Law: any application that can be written in JavaScript, will eventually be written in JavaScript.
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.
Other than these two – You’re basically in line with Atwood – just let the compiler do the work for you and use whatever language you want. Just remember Atwood: eventually it will be written in JavaScript.
Tags: Audio, codec, communication, CPU, design, hardware, multi-core, Optimization, Performance, servers, software, video, video coding, VoIP


Trackback this post | Subscribe to the comments via RSS Feed