Chapter 8. Need for Speed: Optimization and Dynamically Linked Functions
As we have seen a few times already, as long as you vectorize your code1 and use Octave's built-in functionality, there is little you can do to make your code run significantly faster. This is the way it should be. Octave is primarily designed for scientists and engineers, and they should worry about the science, not how to tweak the code for it to perform better. Sometimes, however, you can end up with numerical problems that are not easy or even impossible to vectorize or where no built-in functionality exists. In this chapter, you will see what possibilities you have in these situations.
The chapter is divided into two parts explaining the two main approaches you can consider, namely:
1. Optimizing the Octave code.
2. Implementing the code in a lower level programming language like C or C++ and linking this to Octave's workspace using Octave's C++ library and interface.
It should be mentioned that Octave has no profiler...