Re: performance....

"Saurabh Desai" <[email protected]> Mon, 15 Apr 2002 18:32:14 -0500
Newsgroups gmane.linux.ngpt.user
Message-ID <[email protected]>
Actually, on my 4-way system, I am seeing exactly other way around.
NGPT - about 5 secs.
Linuxthreads - about 48 secs.


- - - - -
Saurabh Desai
POSIX Threading for Linux
IBM  Linux Technology Center
e-mail: [email protected] OR [email protected]
phone: 512-838-2655, T/L: 678-2655




"Richard Seaman, Jr." <[email protected]>@www-124.southbury.usf.ibm.com on
04/15/2002 05:40:18 PM

Sent by:    [email protected]


To:    Bill Abt/Cambridge/IBM@IBMUS
cc:    Corey Minyard <[email protected]>,
       [email protected]
Subject:    Re: [pthreads-users] performance....


On Mon, Apr 15, 2002 at 01:39:06PM -0500, Richard Seaman, Jr. wrote:
> On Mon, Apr 15, 2002 at 09:52:03AM -0400, Bill Abt wrote:
>
> > Most of our benchmarking and testing has involved the same test cases
that
> > are included in the LinuxThreads package.  In these tests, NGPT is
faster
> > in virtually every area.
>
> Since you're able to do thread context switches in userland, as compared
to
> Linuxthreads that does thread context switches in the kernel, your
context
> switches *ought* to be much more efficient.  But I haven't measured this
> directly.
>
> It also appears to me that things like syscalls that can block, mutex
locking,
> and pthread_self among others, are likely to be less efficient in NGPT
than
> Linuxthreads.
>
> I would guess that benchmarks that are dominated by the cost of context
switches
> would favor NGPT.  Other benchmarks might show the opposite, depending on
the
> mix of code.

Well, I was very wrong about the context switching.  NGPT is very slow.
I'm attaching some very simple and very crude benchmark code.

Basically, I started 10 threads each doing 1,000,000 yields simultaneously,
as a very crude measure of context switch overhead. The results (average of
3 runs, details attached):

        NGPT          44.1 secs
        Linuxthreads   7.3 secs

Or, NGPT is slower by a factor of 6! By all logic, NGPT should be faster.

I also did some read/write comparisons.  Basically I did 10 threads each
doing 100,000 reads and writes, yielding after each read and write.  The
results
(average of 3 runs, details attached):

        NGPT          59.3 secs
        Linuxthreads  40.3 secs

Or, NGPT is close to 50% slower.  This might be expected based on the
overhead
in the read/write wrappers in the NGPT code.

--
Richard Seaman, Jr.        email:    [email protected]
5182 N. Maple Lane         phone:    262-367-5450
Nashotah WI 53058            fax:    262-367-5852