Date: Fri, 2 Nov 2001 11:39:15 -0600 From: Alfred Perlstein <bright@mu.org> To: gkshenaut@ucdavis.edu Cc: hackers@FreeBSD.ORG Subject: Re: head(1) speedup Message-ID: <20011102113915.O15052@elvis.mu.org> In-Reply-To: <200111021439.fA2EdbP17494@thistle.bogs.org>; from greg@bogslab.ucdavis.edu on Fri, Nov 02, 2001 at 06:39:36AM -0800 References: <20011102022333.L15052@elvis.mu.org> <200111021439.fA2EdbP17494@thistle.bogs.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Greg Shenaut <greg@bogslab.ucdavis.edu> [011102 08:42] wrote: > In message <20011102022333.L15052@elvis.mu.org>, Alfred Perlstein cleopede: > >can someone please check this out, it makes "head -n" about five > >times faster. (also nukes a 'register', sorry :)) > > I'm curious--does using fgetln here always result in a win, or just > with short lines? I'm thinking of the impact of realloc and memcpy > on speed. Ugh, I should have checked that, my guess is that performance isn't going ot be much worse, if there is a real problem I'll rework it some more, possibly using fread instead of fgetln. -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' http://www.morons.org/rants/gpl-harmful.php3 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011102113915.O15052>