Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Nov 2002 13:21:29 -0800 (PST)
From:      Nate Lawson <nate@root.org>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        arch@freebsd.org
Subject:   Re: malloc(9) performance
Message-ID:  <Pine.BSF.4.21.0211061317110.15820-100000@root.org>
In-Reply-To: <3DC983D9.B94F1474@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 6 Nov 2002, Terry Lambert wrote:
> Nate Lawson wrote:
> > (*) For me, fast enough means sustaining 100000 small (400 byte) and big
> > (64k) allocations/frees per second (one every 10 us).  Maximum memory in
> > use at any point in time would be a few MB.  Latency is my main concern
> > and memory fragmentation much less so.
> 
> For me, the number is closer to 600,000: theoretically, this should
> be the combined mbuf and tcpcb connection struct allocation rate,
> given the maximum possible connection per second rate on a Gigabit
> ethernet's packets-per-secon throughput.

I'm going to get really flamed for this but I did a short test of the
userland malloc and found that I get 33000 mallocs/sec when grabbing 64k
(and then touching one byte on each page) compared to 1800/s when I add in
the small mallocs (one 608 byte, one 400 byte).  So I may be sticking with
a private freelist for the small allocations and use malloc for the large
buf.  Of course, profiling and real tests would be much better but I just
need to make a quick decision for now.

-Nate


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0211061317110.15820-100000>