Le 30/05/2016 15:58, Jean-Marc Lasgouttes a écrit :
Le 30/05/2016 16:40, Guillaume Munch a écrit :
Qt4: 75% of the time is spent (in number of instructions) inside
QTextEngine::shapeText(). Of these 75%, 2/3 is requested by metrics
calculation (QTextLine::setLineWidth() from GuiFontMetrics::breakAt())
and 1/3 by painting (GuiPainter::text()). Ultimately, 74% of the time
is spent in in FT_Load_Glyph and FT_Render_Glyph from
libfreetype.so.6.12.1 (thus, including the metrics phase).
At some time, I had the idea of caching the QTextLine object in the row
element. I suspect this would be a good thing to do.
I do not see the point. You already keep all the useful information.
Keeping the QtextLine object is not going to make setLineWidth run
faster.
We would avoid the double shapeText call between breakAt and draw.
Caching QTextLines is more expensive but much more rich than caching
only the line width.
I cannot see for sure that it will not call shapeText again, but it is
worth a try.
Ubuntu 16.04, callgrind.
Hmm, callgrind. It is so slow that I often do not even think about using
it.
Wild guess, you need to start it with recording off. See:
https://wiki.lyx.org/FAQ/FurtherHelp .
Now if you tried qt5 you could see what fast means :)
I guess that your window manager is set to redraw in real time when
resizing a window, right?
Yes.