From owner-freebsd-net Thu Jul 11 11:43:53 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DB23837B400 for ; Thu, 11 Jul 2002 11:43:50 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id A1C7743E58 for ; Thu, 11 Jul 2002 11:43:50 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 7E694AE03F; Thu, 11 Jul 2002 11:43:50 -0700 (PDT) Date: Thu, 11 Jul 2002 11:43:50 -0700 From: Alfred Perlstein To: Andrew Gallatin Cc: net@freebsd.org Subject: Re: the incredible shrinking socket Message-ID: <20020711184350.GY97638@elvis.mu.org> References: <20020707083710.GM97638@elvis.mu.org> <15661.53007.18632.609465@grasshopper.cs.duke.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15661.53007.18632.609465@grasshopper.cs.duke.edu> User-Agent: Mutt/1.3.27i Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * Andrew Gallatin [020711 11:32] wrote: > > Alfred Perlstein writes: > > Some time ago I noticed that there appeared to be several members > > of struct socket that were either only used by listen sockets or > > only used by data sockets. > > > > I've taken a stab at unionizing the members and we wind up saving > > 28 bytes per socket on i386, and probably nearly double that on > > any 64 bit platform. That's ~15%, which isn't too shabby. > > > > Speaking of 64-bit platforms: While you are shrinking sockets, can > you change the longs in struct sockbuf into ints? I see no reason > to use 64-bit longs for those fields. That should dramatically shrink > a socket on 64-bit platforms. Wollman pointed out that I can't do what I wanted to because of self-connecting sockets. However you should feel free to commit that change yourself. -- -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.' Tax deductible donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message