bin/112613: 'ls -l' is very slow or doesn't work at all

Vyacheslav Silakov seal at inar.ru
Sun Jul 1 20:20:10 UTC 2007


The following reply was made to PR bin/112613; it has been noted by GNATS.

From: "Vyacheslav Silakov" <seal at inar.ru>
To: <bug-followup at FreeBSD.org>
Cc:  
Subject: Re: bin/112613: 'ls -l' is very slow or doesn't work at all
Date: Sun, 1 Jul 2007 23:57:45 +0400

 Ok... ;)
 
 I've a look into ls.c.
 It seems to be a performance problem around string #702
 [...]
 user = user_from_uid(sp->st_uid, 0);
 [...]
 
 My /etc/passwd contains about 10,000 records and /var/mail directory
 contains about 10,000 mailboxes. Probably 'user_from_uid' function is doing
 something wrong.
 
 Original timing:
 # time ls -l /var/mail
 [...]
     1572.20 real       133.71 user       790.94 sys
 
 But when I'm changed 
 user = user_from_uid(sp->st_uid, 0);
 to
 user = "blablabla";
 result is:
 
 # time ./ls -l /var/mail
 [...]
        17.01 real         0.20 user         0.22 sys
 
 p.s. 'deco' program works fine because it doesn't use 'user_from_uid'
 function calls.
 
 
 


More information about the freebsd-bugs mailing list