From owner-freebsd-net Thu Jul 11 11:32:17 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 EB81437B400 for ; Thu, 11 Jul 2002 11:32:14 -0700 (PDT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1AC3E43E42 for ; Thu, 11 Jul 2002 11:32:14 -0700 (PDT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.9.3/8.9.3) with ESMTP id OAA23457; Thu, 11 Jul 2002 14:32:13 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id g6BIVhH41348; Thu, 11 Jul 2002 14:31:43 -0400 (EDT) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15661.53007.18632.609465@grasshopper.cs.duke.edu> Date: Thu, 11 Jul 2002 14:31:43 -0400 (EDT) To: Alfred Perlstein Cc: net@freebsd.org Subject: Re: the incredible shrinking socket In-Reply-To: <20020707083710.GM97638@elvis.mu.org> References: <20020707083710.GM97638@elvis.mu.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid 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 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. Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message