Re: POW: speed up bulk spell checking


Subject: Re: POW: speed up bulk spell checking
From: Ben Mesman (b.mesman@snow.nl)
Date: Tue Aug 28 2001 - 04:58:02 CDT


> > The questions:
> > 1. Where do I implement this? Should there be a special class UT_Idle,
> > or can we modify the UT_Timer to handle both timer-functions and
> > idle-functions?
> > 2. Who will do the other platforms?
> >
>
> These are both tough questions because so far we've explicitly not gone
> down the threads path.
>
> One solution I can think of is to put a bool "bDoAsfastAsPossible" with a
> default = false in the constructor of the timer functions. Platforms with
> a mechanism similar to the gtk_idle function could implement it. If not
> implemented, it defaults to the regular timer semantics.

Just checking if we understand each other: This would mean that at
creation time of the Timer object, we decide if it should be
"bDoAsFastAsPossible". If this is "true" the Timer::set() will have
the same functionality as Timer::start() and the iMilliseconds will be
ignored.

correct? (or is there a better way?)

> A potential problem.
>
> 1. When the spell-check queue is empty, does your code keep polling the
> backgroundCheck method every time gtk_idle say it can? Will this be
> bad for other methods that might want to use gtk_idle?

I don't know.

I do know that we should make sure that the idle function will only
fire when there is something to do. If there is always a function in
the idle queue (even if there is nothing to do) AbiWord will take 100%
cpu-time (though it seems to be a little bit 'nice' i.e. the system is
still quite responsive)

> (I'm thinking of changing the screen repaints to gtk_idle calls
> instead of gtk_timeouts. We might come up with other uses for gtk_idle
> calls too)
>
> I'm not saying this is bad. I really don't know what happens when there
> are several methods in the gtk_idle queue.

I don't know either.

There is also the possibility to set the priority of an idle
function. Does that mean that a lower priority idle function will
never get called if there is a higher priority idle function in the
queue?

I will try to find out.

Cheers,
Ben.

-- 
  Ben Mesman                   Snow b.v. - Unix consultants & OO developers 
  The Amazing Snowmen          Produktgroep Open Source



This archive was generated by hypermail 2b25 : Tue Aug 28 2001 - 04:58:17 CDT