
18 Jul
2009
18 Jul
'09
5:34 p.m.
Add me to the bandwagon ;)
How do you handle the fact that sometimes, compiler may otpimize out benchamrk code because it has no side-effects ?
Ok Joel, now I've run in to precisely the problem you flagged up. Since I uploaded that stuff to the file vault I thought 'better check it with the latest g++' on a different machine. Sure enough when I go to -O1and I see no difference between the function calls... I guess it's just throwing them away! On one hand at least I'm getting consistent results - the relative percentage times reported state that there's no way to tell the difference! On the other, it means I'll have to think a little harder about avoiding this. Any ideas? -ed