public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores
@ 2007-03-17 11:36 bart dot vanassche at gmail dot com
  2007-03-17 11:38 ` [Bug nptl/4209] " bart dot vanassche at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: bart dot vanassche at gmail dot com @ 2007-03-17 11:36 UTC (permalink / raw)
  To: glibc-bugs

Some applications use semaphores for ensuring mutual exclusion, the purpose
mutexes are best suited for. By comparing the performance of such an application
with linuxthreads versus NPTL I discovered that under NPTL semaphores work
slower than under linuxthreads. This behavior occurs at least on ppc32 and i386.

The measurements I performed show that mutexes are about 30% faster under NPTL
than under linuxthreads, and that semaphores are about 70% slower:

$ uname -a
Linux pc-100 2.6.18.6 #8 Sun Feb 4 11:17:43 CET 2007 i686 athlon i386 GNU/Linux
$ /lib/libc.so.6
GNU C Library stable release version 2.5 (20061011), by Roland McGrath et al.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Configured for i686-suse-linux.
Compiled by GNU CC version 4.1.2 20061115 (prerelease) (SUSE Linux).
Compiled on a Linux 2.6.18 system on 2006-11-26.
Available extensions:
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        GNU libio by Per Bothner
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        NoVersion patch for broken glibc 2.0 binaries
        Native POSIX Threads Library by Ulrich Drepper et al
        BIND-8.2.3-T5B
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
$ /home/bart/glibc236/lib/libc.so.6
GNU C Library stable release version 2.3.6, by Roland McGrath et al.
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.1.2 20061115 (prerelease) (SUSE Linux).
Compiled on a Linux >>2.6.18.6<< system on 2007-03-17.
Available extensions:
        GNU libio by Per Bothner
        crypt add-on version 2.1 by Michael Glad and others
        linuxthreads-0.10 by Xavier Leroy
        BIND-8.2.3-T5B
        libthread_db work sponsored by Alpha Processor Inc
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
Thread-local storage support included.
For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.
$ ./perf
NPTL
mutex     Elapsed: 408611 us; per iteration: 40 ns.
semaphore Elapsed: 1901436 us; per iteration: 190 ns.
$ LD_LIBRARY_PATH=/home/bart/glibc236/lib: /home/bart/glibc236/lib/ld-linux.so.2
./glibc236-perf
linuxthreads
mutex     Elapsed: 538978 us; per iteration: 53 ns.
semaphore Elapsed: 1097891 us; per iteration: 109 ns.

-- 
           Summary: Performance issue: NPTL semaphores work slower than
                    linuxthreads semaphores
           Product: glibc
           Version: 2.4
            Status: NEW
          Severity: normal
          Priority: P2
         Component: nptl
        AssignedTo: drepper at redhat dot com
        ReportedBy: bart dot vanassche at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: i686-suse-linux-gnu
  GCC host triplet: i686-suse-linux-gnu
GCC target triplet: i686-suse-linux-gnu


http://sourceware.org/bugzilla/show_bug.cgi?id=4209

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-09-05 12:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-17 11:36 [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores bart dot vanassche at gmail dot com
2007-03-17 11:38 ` [Bug nptl/4209] " bart dot vanassche at gmail dot com
2007-03-17 11:39 ` bart dot vanassche at gmail dot com
2007-03-17 16:46 ` drepper at redhat dot com
2007-03-18  9:16 ` bart dot vanassche at gmail dot com
2007-03-18  9:18 ` bart dot vanassche at gmail dot com
2007-03-18 19:44 ` bart dot vanassche at gmail dot com
2007-03-28  9:23 ` bart dot vanassche at gmail dot com
2007-08-23 18:29 ` drepper at redhat dot com
2007-09-03  9:07 ` bart dot vanassche at gmail dot com
2007-09-05 12:45 ` bart dot vanassche at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).