Subject: Speed of pipes/sockets used locally under NetBSD
To: None <tech-kern@NetBSD.ORG>
From: Neil A. Carson <neil@causality.com>
List: tech-kern
Date: 10/10/1997 18:08:17
Hi all!

I've been doing some optimization work with the ARM at the moment. I've
taken a benchmark from lmbench, which is used to test the bandwidth of
pipes. By default, it forks two processes which in turn read/write 64Kb
chunks of data to a pipe.

On NetBSD/arm32, this is understandably fairly slow; about 4.5Mb/sec,
however because of the virtual cache architecture (and the need to refill
the instruction cache on context switches too) context switches are slow.
So, I rewrote it to use a thread (Provenzano's library) approach, and this
bandwidth doubled to about 9Mb/sec. This is similar to a Pentium-level
(say P166) NetBSD/i386 system.

However, this still seems very slow: I understand pipes are implemented
internally using sockets. Is there some explanation as to why this is the
case? A 133MHz FreeBSD machine appears to be several times faster than the
equivalent NetBSD system, as does Linux.

I wonder, does this mean that one can't obtain the full benefits of using
say a 100BaseT network interface?

No doubt I don't udnerstand all of the issues here, but I'm just asking
for some ideas.

	Regards,

	Neil