From owner-freebsd-arch@FreeBSD.ORG Mon Jul 9 18:08:46 2007 Return-Path: X-Original-To: freebsd-arch@freebsd.org Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 75D7E16A41F for ; Mon, 9 Jul 2007 18:08:46 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from webaccess-cl.virtdom.com (webaccess-cl.virtdom.com [216.240.101.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4180A13C457 for ; Mon, 9 Jul 2007 18:08:46 +0000 (UTC) (envelope-from jroberson@chesapeake.net) Received: from [192.168.1.107] (c-71-231-138-78.hsd1.or.comcast.net [71.231.138.78]) (authenticated bits=0) by webaccess-cl.virtdom.com (8.13.6/8.13.6) with ESMTP id l69I8d15089345 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO); Mon, 9 Jul 2007 14:08:41 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Date: Sun, 8 Jul 2007 14:58:51 -0700 (PDT) From: Jeff Roberson X-X-Sender: jroberson@10.0.0.1 To: Peter Jeremy In-Reply-To: <20070709021408.GK3434@turion.vk2pj.dyndns.org> Message-ID: <20070708145714.B537@10.0.0.1> References: <20070709004640.GA61639@night.db.net> <20070709021408.GK3434@turion.vk2pj.dyndns.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Diane Bruce , freebsd-arch@freebsd.org Subject: Re: select timings X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2007 18:08:46 -0000 On Mon, 9 Jul 2007, Peter Jeremy wrote: > On 2007-Jul-08 20:46:40 -0400, Diane Bruce wrote: >> It is a rather naive test program, close all fd's except >> for 0,1,2 of course, then open /dev/null multiple times, then do >> a select() on each descriptor. ~db/selt.c > > Thanks for the testing. Can you please feed the output through (eg) > src/tools/tools/ministat. > >> I will be trying some other select tests. >> I suspect with a sparse fd_set, jeffr's results will be better than stock. >> We'll see. > > Having a very large number of selected FDs return ready is unrealistic > - I can't think of any real-world situation where this would occur. A > more realistic situation would look like a Poisson distribution with a > small lambda (probably 1). Writing a test suite for this is probably > significantly more effort than your selt.c Well this test is useful because it shows the expected worst case for this patch which is very encouraging since one version of it is not slower than the original select code. That means in the best case we would expect my patch to be much faster. For example, if there were 8k fds and only one triggered my patch only calls fo_poll() on one fd and simply frees the other descriptors. Contrasted with the original code which calls poll all over again on each. Thanks very much for your help Diane. Jeff > > -- > Peter Jeremy >