Martin Vermeer wrote:

On Wed, 2005-12-14 at 10:59 -0500, Bennett Helm wrote:
On Dec 14, 2005, at 10:51 AM, Jean-Marc Lasgouttes wrote:

"Angus" == Angus Leeming <[EMAIL PROTECTED]> writes:
Angus> Do I read top-down correctly as saying that one half of all
Angus> LyX's processing time is spent in doTextTask?

Yes, drawing seems to be very slow with Qt/Mac.
But this doesn't explain why the same version of Qt/Mac together with lyx-1.3.x is relatively speedy! With lyx-1.3.x, there's no lag *at all* in typing into even very large paragraphs, into large insets embedded within large paragraphs, etc. I don't think this can be the explanation of the speed problem in lyx-1.4.0.

So I gave it another try... see attached. This is essentially based upon
the 'row signature' approach mentioned by Jean-Marc in a later post.

What I did wrong in the earlier singlerow patch was, that I tested for
the presence of an inset in the current paragraph by seeing if insetlist
was empty. (This must be done because rows containing insets containing
further text _must be rendered_ in order to render the inside text
through recursive descent.) Now unfortunately almost any paragraph in a
typical text contains _some_ inset, if only a double quote or so.

So I had to make the inset testing more refined. Now the code traverses
the inset list looking for HIGHLY_EDITABLE insets, the only ones that
can contain inner text. While at it, I did this test for every row
separately. Testing with lyxerr-instrumented code in rowpainter showed
this to be highly effective. LyX even _feels_ faster with this patch,
even on Linux.

Currently this is implemented only for "outer" paragraphs, not text
inside an inset. If it does the job, I know precisely what to do to get
also the latter working.
So Bennett, if I may bother you once again to test this for a huge
paragraph _not inside an inset_. If it works, I will extend it for
insets, and the patch can then be included with the Mac binaries to be
published, if at this point we don't want to risk it with 1.4.0. After
all this is a serious regression for one platform.

I tried this on linux (64-bit opteron), and it really helps for long paragraphs.
My 125k single-paragraph test document was still _slow_,
but not nearly as bad as before.  The improvement is
very noticeable in this case.  I went from typing 1-2 lines ahead to
half a line ahead, and scrolling performance is actually acceptable!
(Well, not fantastic, but definitely acceptable.)

With this patch (and an update from yesterdays to todays cvs)
I also got rid of some
display artifacts. Lyx from my last compile had a habit of putting several
sets of text on top of each other when scrolling s-l-o-w-l-y through
the monster paragraph.  And it wasn't just a speed problem - the
bad display remained after the cpu finished its work.  (Marking
the text fixed it).  No such problem now - although I can't know whether
it was this patch or the cvs update that fixed this.

Still, the speed improvement alone makes me hope this goes into 1.4.
If it goes in for mac anyway, why deny other users the same pleasure? :-)
Maintaining a different lyx for mac seems to be extra work too . . .

Please tell if there is anything special I could do for stability/correctness
testing of this patch.

Helge Hafting

Reply via email to