Re: Nautilus property dialog refresh bounding patch -- not good



On Fri, 2003-09-12 at 11:10, Alexander Larsson wrote:

> > I am very little convinced about the usefulness of the patch: the update
> > functions in the property dialog are horribly inefficient and bounding
> > the number of times they can be called per second with a timeout is not
> > the solution. If you disable completely the timeout (remove the
> > g_timeout_add in the schedule function), you will notice that changing
> > the permissions of a group of files (around 40) is almost instantaneous
> > which shows what a scary burden these update functions put on the
> > machine.
> 
> There are some issues with this patch.
> 
> deep_count_started seem to never get set back to FALSE, meaning it will
> continue to call directory_contents_value_field_update.
> 
> The way the rate limiting is done means the timeout function will keep
> being called all the time even when there are no changes happening.
> Thats not good. What we want to do is, whenever something changes we
> call schedule_timeout, which schedules a timeout if there isn't one
> already, and the timeout runs only once.

Ah, I see. This sounds like a great idea. Shame on my lack of
experience. I will do so.

> 
> The way update_contents_callback() works is just way to slow. Calling
> properties_window_update() for each changed file is a O(n^2)
> operation[1], since properties_window_update() loops through all the
> files in the dialog. properties_window_update() has to be changed to
> take a list of changed files so it does things that loop over all files
> only once.

Yes, exactly. I was thinking about doing something along these lines.
since we already have a list of files changed in the timeout callback,
it should be easy.

Thanks for your comments,
Mathieu
-- 
Mathieu Lacage <mathieu gnu org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]