On Wed, Dec 01, 2010 at 02:17:53PM -0800, Fred Cisin wrote:
Assembly language is necessary if one is to get full optimization of
performance. Many people don't agree with that, and insist that throwing
more hardware at it is easier, particularly for people in a big hurry.
I strongly disagree. I've read the other replies but none have touched
on one big reson why assembly is less important today:
Memory latency!
I doesn't matter if your loop is unrolled or made to avoid bubbles in
the pipeline if you have to wait some 100 ns for data because of a cache
miss. Optimizing today means keeping your memory management straight.
The levels of indirection imposed by high level languages and virtual
machines doesn't help, which is an argument for assembly :)
Another argument for assembly is that it tends to make your code
smaller.
However, in the end, I think the key to fast code is to know your
hardware, your compiler and your problem domain, none of which is easy.
Cheers
- Pontus