Work on a problem requiring GA. I have everything that works, and spent a lot of time trimming fat and optimizing the code before resorting to compiler optimization. Since GA works as a result of user input, it must find a solution within a reasonable period of time, otherwise the user interface will be closed and it just won't play well. I got this binary GA resolving 27 variable problems in about 0.1 s on iPhone 3GS.
To achieve this level of performance, the entire GA was encoded in C, not Objective-C.
In search of further reduction in runtime, I considered the idea of ββusing the β-O3β optimization switch only for the solver module. I tried, and it reduced the work time by almost half.
Do I have to worry about any reason setting optimization to "-O3"? Keep in mind that I am doing this at the file level, and not for the entire project.
source share