Date: Tue, 27 Jul 1999 12:09:35 -0400 From: Garance A Drosihn <drosih@rpi.edu> To: Tim Vanderhoek <vanderh@ecf.utoronto.ca>, Dag-Erling Smorgrav <des@yes.no> Cc: hackers@FreeBSD.ORG, howardjp@wam.umd.edu Subject: Re: replacing grep(1) Message-ID: <v04011700b3c3885c9a13@[128.113.24.47]> In-Reply-To: <19990727092941.A34599@mad> References: <19990727082344.B33399@mad>; from Tim Vanderhoek on Tue, Jul 27, 1999 at 08:23:44AM -0400 <xzpd7xeb9xc.fsf@des.follo.net> <19990727082344.B33399@mad>
next in thread | previous in thread | raw e-mail | index | archive | help
At 9:29 AM -0400 7/27/99, Tim Vanderhoek wrote: > On a file with 100000+ lines, the speed difference is rather > restrictive. [...] Only about 10% of the time is spend in > procline(). There seems to be a lot of unnecessary strncpy() > that could be _easily_ avoided if free() on util.c:130 was > avoided, but I'll let the authors speak first. :-) Hmm, strncpy? Are these calls which really want strncpy for what it was originally designed for, or are they just trying to prevent buffer overruns? If it's the buffer-overrun answer, then maybe this would be a good test case for using strlcpy instead of strncpy, and see if it makes a performance difference (since the code won't waste it's time nulling-out bytes that don't need to be nulled-out). --- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or drosih@rpi.edu Rensselaer Polytechnic Institute 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?v04011700b3c3885c9a13>