Abdelrazak Younes wrote:
Helge Hafting wrote:
Now this is interesting. If the number of {}'s is an indication, the
LyX does 18 times as much work when typing in a partially visible
paragraph. And yes, with this window size, there were exactly 18
lines in the paragraph.
Please try again with rev 20536.
You fixed that problem - great!
The "W" test now shows another oddity though:
Arrange one paragraph with 25 lines.
Type a string og W's in the next paragraph. The W's comes out with
great speed until this second paragraph needs to linewrap. The wrap
takes a "long" time, and then things continue at great speed. The linewrap
is noticeable, and lyx -dbg prints this at that point:
void lyx::BufferView::updateMetrics(bool)
y1: -424 y2: 411 pit1: 2 pit2: 3 npit: 4 singlepar: 1
BufferView::updateMetrics
InsetCache contains:
WorkArea::redraw screen
*** START DRAWING ***
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
*** END DRAWING ***
InsetCache contains:
WorkArea::redraw screen
*** START DRAWING ***
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
{10}
*** END DRAWING ***
InsetCache contains:
The current and the previous paragraph is 27 lines, and here we see
27 {10}'s, and they appear twice too.
This seems excessive. Things happen _twice_. (Or perhaps that is two
different necessary happenings that just prints the same way?)
Anyway, why all this work on the lines of the previous paragraph? Is
that necessary? Is it even necessary to consider all lines in "this"
paragraph,
seems to me that the line being broken is the only one that needs
handling. And of course any following lines in the same paragraph, but there
were none in this test.
I don't know if there are any more easy optimizations, but it seems
unnecessary to look at the previous paragraph as well as earlier lines
in the same paragraph. None of those ever changes when LyX breaks a line,
they can just sit there or the windowing system can shift them up if
needed. (Or was that one of those things that'd be nice to have but
don't actually happen?)
Helge Hafting