From owner-freebsd-hackers Fri Jul 5 15:46:11 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B81F037B400 for ; Fri, 5 Jul 2002 15:46:08 -0700 (PDT) Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 76F8B43E09 for ; Fri, 5 Jul 2002 15:46:08 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0052.cvx40-bradley.dialup.earthlink.net ([216.244.42.52] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17Qbq2-0007H1-00; Fri, 05 Jul 2002 18:46:06 -0400 Message-ID: <3D262184.978B902A@mindspring.com> Date: Fri, 05 Jul 2002 15:45:24 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Richard Sharpe Cc: freebsd-hackers@freebsd.org Subject: Re: Adding readdir entries to the name cache ... References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Richard Sharpe wrote: > On Thu, 4 Jul 2002, Terry Lambert wrote: > [major snippage, much useful to think about here ...] > > > However, ls seems to call lstat in the same order that the files are in > > > the directory, and a normal clock approach to directories would yield > > > exactly the same result. Further, in the cases that the user did not want > > > a -l, we would avoid adding many potentially useless names to the name > > > cache and reducing its performance. > > > > This is because the sort occurs first. An unsorted "ls" (which is > > available -- see the man page) doesn't have this issue. > > I don't want to start a flame war, but a truss of ls -l shows the > following: [ ... ] > This suggests that the ls is doing an unsorted lookup of the info, and > then sorting. That is the way I would have done it as well. My bad; I had assumed that what he said he was observing was actually what he was observing. It may be that he's installed an ls replacement or something, or it could just be an artifact of the directory he's looking in. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message