On 10/08/2009 23:23, Vincent van Ravesteijn wrote:
Abdelrazak Younes schreef:
On 10/08/2009 23:10, Abdelrazak Younes wrote:
On 10/08/2009 23:03, Vincent van Ravesteijn wrote:
Abdelrazak Younes schreef:
On 10/08/2009 22:57, Vincent van Ravesteijn wrote:
you...@lyx.org schreef:
Author: younes
Date: Mon Aug 10 22:54:22 2009
New Revision: 30970
URL: http://www.lyx.org/trac/changeset/30970

Log:
Move the inline spellchecking code from collectWords() to the row drawing routine. The text row is spell checked only if changed!

Now inline SpellChecker is faster than ever. Now, I honestly think that we blow out all the competitors (thunderbird, OO, MSWord, etc) :-)

SpellChecking in the RowPainter code ?

Against your religion?

Abdel.

Let's do updateLabels in the rowPainter, and updateMacros, and setBuffer ?

Let's be a little bit pragmatic here:
1) Even if this is not obvious, this spellckecker code has something to do with drawing: the purpose is precisely to draw spellchecking marks. 2) There is absolutely no need to draw spellchecking marks outside of the visible text area 3) There is no need to redo spellchecking if the row contents did not change 4) the row painting code is the *only* place where we check if the contents has changed.

That being said, if you have any clever or cleaner idea, I am all ears :-)

Abdel.

Don't you need to check only the word that has just finished being edited and other changes made to the text. The rest only once when it is shown for the first time. Now each word is checked trillion times over and over again.

Correct. While I agree we could do even better, this is still _much_ better that the competition I am sure. And the code is very simple. Now, if we really want to bother about these few CPU cycles wasted, we could implement something smarter using notyCursorLeave() and co. You'll also need to take care of all the corner cases like paragraph breaking, couple words pasted in between two other word (thus making 3 or 4 words to check, not one)...


Are the spellcheck dictionaries in the memory ? I hope that I would not have to read from disk everytime.

Nope, there is something called the disk cache. I am betting you will never, ever noticed any slowdown because of this, pretty sure of that.

Abdel.


Reply via email to