From owner-freebsd-questions@FreeBSD.ORG Wed Nov 28 16:25:53 2007 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1B8A16A477 for ; Wed, 28 Nov 2007 16:25:53 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 5453F13C457 for ; Wed, 28 Nov 2007 16:25:53 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from epia-2.farid-hajji.net (epia-2 [192.168.254.11]) by fw.farid-hajji.net (Postfix) with ESMTP id C58ADDFAB3; Wed, 28 Nov 2007 17:25:51 +0100 (CET) Date: Wed, 28 Nov 2007 17:25:49 +0100 From: cpghost To: "Mark Evans" Message-ID: <20071128172549.00eb2ddc@epia-2.farid-hajji.net> In-Reply-To: <002001c831d5$80ad8670$0d00a8c0@bayoucshaffer> References: <005901c8313f$f7048b70$0d00a8c0@bayoucshaffer> <474CA49D.50306@FreeBSD.org> <002001c831d5$80ad8670$0d00a8c0@bayoucshaffer> Organization: Cordula's Web X-Mailer: Claws Mail 3.0.2 (GTK+ 2.12.1; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org Subject: Re: ls -l takes a forever to finish. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Nov 2007 16:25:53 -0000 On Wed, 28 Nov 2007 09:44:03 -0600 "Mark Evans" wrote: > No we are not using NIS. > > it is a large directory i am listing. actually it is the /usr/home > directory, and is probably the largest on the system. However "ls -l" > runs for close to six minutesand spends the 10 seconds scrolling the > screen with the results. so i wait ls to start showing the results > for about 5 and a half minutes. Even on a older and much slower > system i've never seen it talk more than 15 seconds to complete. Does it run (much) faster with the -f flag or -lf flags? I have a similar problem with *huge* directories: sorting them is incredibly slow... though -l makes no difference; it's the sorting itself than makes one think it is O(N^2) instead of O(N log N). It could be a pathological case of Quicksort (ls(1) calls fts_open(), which itself calls fts_sort() from /usr/src/lib/libc/gen/fts.c, and that function calls qsort(3); so it's not entirely impossible... -cpghost. -- Cordula's Web. http://www.cordula.ws/