On Tue, 2005-12-13 at 17:03 +0100, Jean-Marc Lasgouttes wrote: > >>>>> "Martin" == Martin Vermeer <[EMAIL PROTECTED]> writes: > > >> TransManager::TranslateAndInsert(char, LyXText*) (lyx) > > Martin> The last one is fascinating. Inside the code it says: > > Note that this part of the tree is collapsed. Probably > TranslateAndInsert triggers lots of other things. Actually, from the > following list > > - 19.6% TransManager::TranslateAndInsert(char, LyXText*) (lyx) > - 19.6% TransManager::insert(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, LyXText*) (lyx) > - 19.6% TransManager::insertVerbatim(std::basic_string<char, > std::char_traits<char>, std::allocator<char> > const&, LyXText*) (lyx) > - 19.6% LyXText::insertChar(LCursor&, char) (lyx) > - 19.6% LyXText::setCursor(LCursor&, int, int, bool, bool) (lyx) > - 19.6% LyXText::setCursorIntern(LCursor&, int, int, bool, bool) (lyx) > - 19.6% LCursor::setTargetX() (lyx) > > it is not difficult to see that all the time is spent in setTargetX, > which rebreaks the paragraph.
Ah yes of course. Is there a way to suppress this? What I see is that always another call to redoParagraph seems to follow, from BufferView::Pimpl::metrics. My feeling is that one of them is superfluous. > Martin> BTW about understanding this output: is it like a tree: > > Yes. OK, thanks. > Martin> Hmmm... but a lot less than we used to with this patch. > > Not in the case used by Bennett (typing in an inset). No, that amazes me... because even in this case, I have reduced the number of calls to redoParagraph by 20% at least, even if you play the devil's advocate. Yet, Bennett sees no more than half of that in speedup. I reduced the area drawn / number of drawings by 50% at least, no matter how you count it, and that seems to show nowhere. So where else is LyX eating time if not in rebreaking and drawing? > Two interesting points from the list at the end are: > > - 49.9% QFontMetrics::width(QChar) const (lyx) > - 34.2% QPainter::drawText(int, int, QString const&, int, > QPainter::TextDirection) (lyx) > > So we spend a _lot_ of time querying width, and if you add the text > drawing (but I suspect you can't really add them), you get a lot. The width querying is mostly from redoParagraph too, I suspect. - Martin
signature.asc
Description: This is a digitally signed message part