From owner-freebsd-questions Sat Feb 17 16:51:37 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id 221D437B401; Sat, 17 Feb 2001 16:51:30 -0800 (PST) Received: from rfx-216-196-73-168.users.reflexcom.com ([216.196.73.168]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Sat, 17 Feb 2001 16:49:34 -0800 Received: (from cjc@localhost) by rfx-216-196-73-168.users.reflexcom.com (8.11.1/8.11.1) id f1I0pOr34264; Sat, 17 Feb 2001 16:51:24 -0800 (PST) (envelope-from cjc) Date: Sat, 17 Feb 2001 16:51:24 -0800 From: "Crist J. Clark" To: Cliff Sarginson Cc: Peter Pentchev , Artem Koutchine , questions@FreeBSD.ORG, security@FreeBSD.ORG Subject: Re: Efficiency [Was: Re: rpc.statd attack] Message-ID: <20010217165124.C62368@rfx-216-196-73-168.users.reflex> Reply-To: cjclark@alum.mit.edu References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from cliff@raggedclown.net on Fri, Feb 16, 2001 at 03:03:44PM +0000 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, Feb 16, 2001 at 03:03:44PM +0000, Cliff Sarginson wrote: [snip] > As you can see makes all the difference :) > But this is under Solaris ... > > $ time rpcinfo -p | egrep -e 'udp.*status$' | awk '{print $4}' > 32790 > > real 0m0.12s > user 0m0.04s > sys 0m0.07s > > $ time rpcinfo -p | awk '($3 == "udp") && ($5 == "status") {print $4 }' > 32790 > > real 0m0.11s > user 0m0.05s > sys 0m0.04s Shocking. rpcinfo takes the same amount of time to run in both examples. You are not incuding the awk's and grep's in your measurements. ITYM, $ rpcinfo -p | time egrep -e 'udp.*status$' | time awk '{print $4}' 996 0.05 real 0.00 user 0.00 sys 0.04 real 0.00 user 0.00 sys $ rpcinfo -p | time awk '($3 == "udp") && ($5 == "status") {print $4 }' 996 0.03 real 0.00 user 0.00 sys -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message