I know debug mode is slower and that's why I don't make final releases with it. What I'm getting at is that consistant optimisation reduced the time taked by a function in debug mode by 4 times, yet in non debug mode the time always remained at 13. Maybe something other than the function was limiting the time such as accessing video ram or something.