On Thu, Aug 24, 2006 at 10:46:27AM -0700, Noel Dellofano wrote: > ZFS actually uses the ZAP to handle directory lookups. The ZAP is > not a btree but a specialized hash table where a hash for each > directory entry is generated based on that entry's name. Hence you > won't be doing any sort of linear search through the entire directory > for a file, a hash is generated from the file name and a lookup of > that hash in the zap will be done. This is nice and speedy, even > with 100,000 files in a directory.
I just tried creating 150,000 directories in a ZFS roto directory. It was speedy. Listing individual directories (lookup) is fast. Listing the large directory isn't, but that turns out to be either terminal I/O or collation in a UTF-8 locale (which is what I use; a simple DTrace script showed that to be my problem): % ptime ls ... real 9.850 user 6.263 <- ouch, UTF-8 hurts sys 0.245 % % LC_ALL=C ptime ls ... real 4.112 <- terminal I/O hurts -- I should redirect to /dev/null user 0.682 sys 0.252 % % LC_ALL=C ptime ls > /dev/null real 0.793 user 0.608 sys 0.184 <- not bad % % LC_ALL=C ptime sh -c 'echo *' ... real 1.357 <- more compact output than ls(1) user 0.970 sys 0.090 % % ptime ls -a x12345 . .. real 0.022 user 0.000 sys 0.002 % Awesome. Nico -- _______________________________________________ zfs-discuss mailing list zfs-discuss@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/zfs-discuss