Re: Fast file access (was Re: [ANN] Shovel - Third-Party "Software Update")
Re: Fast file access (was Re: [ANN] Shovel - Third-Party "Software Update")
- Subject: Re: Fast file access (was Re: [ANN] Shovel - Third-Party "Software Update")
- From: Daniel Waylonis <email@hidden>
- Date: Fri, 9 Apr 2004 16:32:26 -0700
On Apr 3, 2004, at 4:57 AM, Alastair Houghton wrote:
>
On 3 Apr 2004, at 07:25, mathew wrote:
>
>
> Anyone feel like doing some speed comparisons between Cocoa, Carbon
>
> and BSD for trawling every folder on a big hard disk, to put this one
>
> to rest?
>
>
Some figures I just obtained for a search of every file and directory
>
on my hard disk:
>
>
Carbon (using FSCatalogSearch) 54.9 seconds
>
Cocoa (using NSDirectoryEnumerator) 148.1 seconds
>
BSD (using opendir(), readdir() et al.) 129.1 seconds [...]
Hi Alastair,
You might have better luck with fts() (man fts) on the Posix side. I
did some testing against FSGetCatalogInfoBulk() (the fastest) and found
that it was pretty close in performance.
Scanning "/Library/Developer":
fts 8675 Directories, 51908 files (7.8 sec - 13.9 sec)
FSGetCatalogInfoBulk 8674 Directories, 55678 files (2.9 sec - 3.3 sec)
(128 directory entries at a time)
I'm not sure why there's a discrepancy between the # of directories &
files, but it the fts is probably skipping invisible files.
Dan
_________________________________________________
Dan Waylonis email@hidden
Software Engineer
http://www.nekotech.com
nekotech SOFTWARE 650.964.2490 (O)
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.