Am 02.09.2010 um 09:38 schrieb Jean-Marc LASGOUTTES:

> Stephan Witt <st.w...@gmx.net> writes:
>>> I fear this is going to become very fragile.
>> 
>> That's why I stopped here and see currently no need to reduce the
>> spell check range to the current word.
> 
> What do you mean?

I meant I did not implement the logic to check only the current word on 
user input. This is not really needed. Checking of the current paragraph is 
fast enough.

> 
>> When typing this is ok. But on scroll you have a complete spell check
>> of the visible part again and again.
> 
> What kind of scrolling? Page Up/Down or one line at a time? 

Both. Even on redraws caused by focus changes - when LyX gets input focus again.
You can verify that (without the patch) when using "-dbg gui".

> 
>> The point is to catch all possibilities to change paragraph contents.
>> But that holds true for change tracking either. Perhaps a common
>> method can simplify that... But every change of content has to go
>> through Paragraph methods. So it must be doable with little effort.
> 
> My view is: either (1) your current code is fast enough and you should
> simplify it by getting rid of range-setting functions for misspelled
> words; or (2) a more complicated thing is necessary and you should
> integrate the misspelled info into Font object, since you are sure that
> this one is correctly updated. There is no point in recreating yet
> another Font-like property and update it in all points of the document.
> 
> So I propose to profile your current code and see whether there are
> things that seem wrong (typing in a paragraph that is very long, for
> example). And go for the more complicated version only if the profiler
> shows something.

I could go back to the row based spell check and abandon the checker state of 
paragraph.
But I decided to do the move from row to paragraph checking when seeing the 
loop code in
Buffer.cpp which implements the explicit spell check with F7.
This code iterates word wise without knowledge of screen rows (of course). So 
the
performance problem pops up here again.

That's not so easy to catch or change and I didn't want to introduce new if 
canCheckParagraph
logic in Buffer.cpp.

Now I don't know what to do next...
I'd like to apply the enhanced patch (I would post again) and move on from 
there.

Stephan

Reply via email to