Performance improvements with the aid of gprof