From owner-freebsd-net Sun Jul 7 15:41:16 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 5098337B400; Sun, 7 Jul 2002 15:41:14 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1509C43E09; Sun, 7 Jul 2002 15:41:14 -0700 (PDT) (envelope-from baka@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1921) id D99D6AE162; Sun, 7 Jul 2002 15:41:13 -0700 (PDT) Date: Sun, 7 Jul 2002 15:41:13 -0700 From: Jon Mini To: Juli Mallett Cc: Mike Silbersack , Alfred Perlstein , net@FreeBSD.ORG Subject: Re: the incredible shrinking socket Message-ID: <20020707224113.GP55378@elvis.mu.org> References: <20020707083710.GM97638@elvis.mu.org> <20020707143846.A13771-100000@patrocles.silby.com> <20020707131421.A50599@FreeBSD.ORG> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020707131421.A50599@FreeBSD.ORG> 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 On Sun, Jul 07, 2002 at 01:14:21PM -0700, Juli Mallett wrote: > * De: Mike Silbersack [ Data: 2002-07-07 ] > [ Subjecte: Re: the incredible shrinking socket ] > > > > On Sun, 7 Jul 2002, Alfred Perlstein wrote: > > > > > 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. > > > > Unions are ooogly. Would it be possible to seperate listen-only > > structures out into a seperate struct instead with a pointer to it? > > If you're going to do that why not just end the struct with > char foo[1]; > > And overlay the unique bits at the end? Because that is even more oogly than a union. -- Jonathan Mini http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message