I have a process I need to optimize and I was wondering how long a multiplication operation takes between two doubles. If I can cut off 1000 of these, I want to know if it will actually make a difference in the overall performance of my process?
Share
This is highly system specific. On my system, it only takes a few milliseconds to do 10 million multiplication operations. Removing 1000 is probably not going to be noticeable.
If you really want to optimize your routine, this isn’t the best approach. The better approach is to profile it, and find the bottleneck in your current implementation (which will likely not be what you expect). Then look at that bottleneck, and try to come up with a better algorithm. Focus on overall algorithms first, and optimize those.
If it’s still too slow, then you can start trying to optimize the actual routine in the slower sections or the ones called many times, first.
The only effective means of profiling is to measure first (and after!).