[wplug] relevance of C for Apps

Michael Skowvron skowvron at verizon.net
Wed Oct 6 15:38:59 EDT 2004


Bill Moran wrote:

  ...some some really good comments and analsis...

I would like to add my opinion and suggest that many programmers don't 
have access to adequate performance analysis and profiling tools. I 
agree with everything Bill says about the performance and development 
tradeoffs of the various languages; but my opinion is, from a purely 
performance-oriented viewpoint, the programmer's knowledge or choice 
of algorithms has the most impact.

I have seen some terrible C applications and some good performing Java 
ones. As an example, I had to rewrite portions of an MPEG-2 
demultiplexer because it would only process 3MB/sec. Once I rewrote 
just a couple of routines I was able to get 35+MB/sec, which was the 
limit of my SCSI-3 controller's capability.

I did this very quickly by running the code through a profiler to see 
where all of the cpu cycles were being spent. Then I went straight to 
those routines, found the horribly ineffecient code, and rewrote just 
that section. I'm not much of a programmer and probably couldn't have 
written the demuxer from scratch, but by knowing how to use a profiler 
I was able to find the bottleneck quickly and improve the performance 
by at least an order of magnitude.

If more programmers used performance analysis and profiling tools, 
they could quickly locate the routines that consume the most time and 
focus on optimizing them. There is no need to worry about optimizing 
the entire application if 80% of the time ends up in a handfull of 
routines.

Michael



More information about the wplug mailing list