Previous: , Up: Advanced Usage   [Contents][Index]


3.3 Optimizer Tips

Compilers are usually allowed to throw away any computation whose effects are not visible. Micro benchmarks usually throw away the result of the computation at each iteration, and the compiler might be really nice to you and move or throw the code under test with it. At the end of the day, the fastest execution is achieved executing no code at all.

If you are experiencing these kind of problems, see Optimization Utilities Reference for useful functions to tell the compiler we need the values produced by the code under test. Users of the C++ binding can check See C++ Optimization Utilities Reference for their equivalents. Guile binding doesn’t implement yet these kind of helpers.

These tools must be used carefully, as the compiler might well find ways to comply with our requirements with less work than we expected—really a big kudos compiler writers. Your mileage may vary.