On Tue, Nov 07, 2006 at 11:14:03PM +0100, Abdelrazak Younes wrote: > Asger Ottar Alstrup wrote: > >Asger Ottar Alstrup wrote: > >>Try running LyX with a command line parameter "-dbg any" and inspect > >>the output when redrawing. If lots of stuff is coming out, review that > >>output to make sure it is not done like the above. > > > >Most of it was done wrong - some of it even using monsters like > >BOOST_CURRENT_FUNCTION. Who knows what voodoo that shit does? > > > >I've changed it. Please test. There is a fair chance this gives a nice > >speedup, maybe even on MacOS as well. > > That would be an easy way out but I am not convinced... Visually > speaking, all these if are not very nice...
That's why we shoul use macros there: Instead of lyxerr[Debug::PAINTING] << "draw " << std::string(str.toUtf8()) << " at " << x << "," << y << std::endl; which is slow, or if (whatever(Debug::PAINTING)) { lyxerr[Debug::PAINTING] << "draw " << std::string(str.toUtf8()) << " at " << x << "," << y << std::endl; } which is (significantly) faster but too noisy to be useful on a big scale LYXERR("draw " << std::string(str.toUtf8()) << " at " << x << "," << y); should be used. This is as fast a the second version and even more compact than the first. Andre'