commit: Give more CPU to word processing after startup.

From: <msevior_at_physics.unimelb.edu.au>
Date: Mon Aug 08 2005 - 01:46:42 CEST

CVS: ----------------------------------------------------------------------
CVS: Enter Log. Lines beginning with `CVS:' are removed automatically
CVS:
CVS: Committing in .
CVS:
CVS: Modified Files:
CVS: src/text/fmt/xp/fl_DocLayout.cpp
CVS: src/text/fmt/xp/fl_DocLayout.h
CVS: ----------------------------------------------------------------------
Give more CPU to other regular word processing after startup with grammar
checking.

The problem is that grammar checking is VERY CPU intensive. If you have a
big document and have grammar checking enabled it will take ages to check
the entire document.

The grammar checking is run as a background process as a timer event. The
timer is set to fire every 0.5 seconds. However often grammar checking a
paragraph takes more than 1 second. If this happens then the timer will be
ready to fire again which ends up compteting with regular Word processing
actions like type, scrolling etc.

This commit works around this problem by only doing a grammar check on
every 4th timer event immediately after the document has loaded.

After the whole document has been grammar checked once, grammar checking
occurs every 0.5 seconds as before.

I think this works a bit better although of course it takes longer to do
the initial grammar check of large documents.

I noticed that MS Word has a similar solution. It takes MS Word ages to
complete the initial grammar check of a large document.

Cheers

Martin
Received on Mon Aug 8 01:46:25 2005

This archive was generated by hypermail 2.1.8 : Mon Aug 08 2005 - 01:46:26 CEST