public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bart dot vanassche at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: glibc-bugs@sources.redhat.com
Subject: [Bug nptl/4209] New: Performance issue: NPTL semaphores work slower than linuxthreads semaphores
Date: Sat, 17 Mar 2007 11:36:00 -0000	[thread overview]
Message-ID: <20070317113630.4209.bart.vanassche@gmail.com> (raw)

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.


             reply	other threads:[~2007-03-17 11:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-17 11:36 bart dot vanassche at gmail dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070317113630.4209.bart.vanassche@gmail.com \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=glibc-bugs@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).