Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Jul 2002 12:53:21 -0700
From:      Alfred Perlstein <bright@mu.org>
To:        Mike Silbersack <silby@silby.com>
Cc:        net@freebsd.org
Subject:   Re: the incredible shrinking socket
Message-ID:  <20020707195321.GN97638@elvis.mu.org>
In-Reply-To: <20020707143846.A13771-100000@patrocles.silby.com>
References:  <20020707083710.GM97638@elvis.mu.org> <20020707143846.A13771-100000@patrocles.silby.com>

next in thread | previous in thread | raw e-mail | index | archive | help
* Mike Silbersack <silby@silby.com> [020707 12:36] wrote:
> 
> 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?

Possibly, but the additional pointer dereference would be expensive
and a lot of code would have to change without the compatibility
macros.

I sort of did it as a proof of concept, but of course since it doesn't
completely work I haven't proved it. :)


-- 
-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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020707195321.GN97638>