Optimizing a C++ program
Posted 2005-03-26 12:00. Tagged c++, hack, performance, neural network.
A small case study of how to optimize a C++ program.
A while ago, Michael Strömberg presented a “Quick Java & C# Performance Comparison” on his blog. As a basis for comparison, he included the original C++ reference implementation of the algorithm, a pulse-coupled neural network. The reference program was slower than Michaels java code even on the slowest of the Java environments.
Since I believe that a reasonably sane implementation in C++ has a good chance of outperforming even a well-tuned Java implementation, I decided to take a look at the reference implementation and see if it could be made to run faster. It certainly could.