Jean-Marc Lasgouttes wrote: >>>>>> "Peter" == Peter Kümmel <[EMAIL PROTECTED]> writes: > > Peter> With enabled USE_LYX_FONTCACHE it is a little bit faster > Peter> (because the value of QLFontInfo::width becomes smaller > Peter> compared to the others: enabled 100<->48, disabled 100<->47) > > I'd say it is the same (the margin error is important, I think).
You are right (48, 47, 50, 47, all enabled) and I would say, without calculating, at least +- 2%. The times of the last message are BOTH from enabled, my fault, I've overseen the macro definition in the header. This is the result when the lyx-cache is disabled Normalized used time in % QLFontInfo::width................................. : 100 QLPainter::fillrectangle.......................... : 7 QLPainter::line................................... : 1 QLPainter::setQPainterPen......................... : 5 QPainter::drawText in QLPainter................... : 34 qfont_metrics.C::descent.......................... : 1 qfont_metrics.C::maxDescent....................... : 1 qfont_metrics.C::minDescent....................... : 2 qfont_metrics.C::signedWidth...................... : 11 Because "QPainter::drawText in QLPainter" is still the same time, then it's clear that Qt's cache is slower (100/34 > 100/48)! (Maybe I should normalize on the drawText time.) > Note that there is room for improvement in our fontcache which uses a > std::map. A vector will probably not use too much memory (for 8bit > fonts) and be much faster. > > JMarc > > I've an idea...