Bug 99364

Summary: FAM iuses quadratic algorithm
Product: [Retired] Red Hat Linux Reporter: Søren Sandmann <sandmann>
Component: famAssignee: Alexander Larsson <alexl>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 9CC: mitr, rdieter
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-08-05 08:16:27 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
the patch none

Description Søren Sandmann 2003-07-17 22:29:22 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030516
Mozilla Firebird/0.6

Description of problem:
When loading big directories with nautilus, FAM is using a lot of CPU time. I
profiled it and found that the time is spent pretty much exclusively in
DNotify::watch_dir(), specifically in the loop that walks the list of file
watches to see if the file is already watched.

I'm attaching a patch that just looks in the existing hash table and checks if
the filewatch->dir_watch is equal to the current dir_watch. I am not actually
sure that last check is necessary, though.

The closest thing to real numbers I have is the time it takes nautilus to load
/dev. It was around 23 seconds before and is around 18 seconds now.



Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1. n/a
2. 
3.     

Additional info:
Comment 1 Søren Sandmann 2003-07-17 22:30:51 EDT
Created attachment 92997 [details]
the patch
Comment 2 Alexander Larsson 2003-08-05 08:16:27 EDT
Fixed in 2.6.8-11. I also changed the hashtable sizes to be slightly larger and
have prime sizes.