From: daniel.baluta@gmail.com (Daniel Baluta)
To: kernelnewbies@lists.kernelnewbies.org
Subject: syscalls performance
Date: Fri, 25 Feb 2011 19:15:59 +0200 [thread overview]
Message-ID: <AANLkTiniirL=jN=yOmsev6MF3a1mpwGUkm-_Qu7zh6AR@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimZac++X4jUsz2-bTTtEJwOR45NHAQ=GR3xCVnG@mail.gmail.com>
Hi Mauro,
On Fri, Feb 25, 2011 at 7:03 PM, Mauro Romano Trajber <trajber@gmail.com> wrote:
> I was doing some performance tests of system calls and I find an interesting
> behavior.
> Using RDTSC to count the CPU cycles, a single call to the getpid() consumes
> about 7k of CPU clock cycles and ten calls consume approximately 9,800
> cycles.
> The fact is that from the second call, the CPU cycles grows at a rate of
> about 350 CPU cycles per call.
> Why does this happen? There is some hardware optimization when the syscall
> ID is already in EAX register ?
Use strace and check to number of getpid() syscalls.
You'll notice that only 1 system call is made, glibc caching the pid value.
thanks,
Daniel.
next prev parent reply other threads:[~2011-02-25 17:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-25 17:03 syscalls performance Mauro Romano Trajber
2011-02-25 17:15 ` Daniel Baluta [this message]
2011-02-25 18:22 ` Mauro Romano Trajber
2011-02-25 20:15 ` Daniel Baluta
2011-02-25 20:30 ` Mauro Romano Trajber
2011-02-25 20:42 ` Enrico Granata
2011-02-25 20:59 ` Jim Kukunas
2011-02-25 21:00 ` Enrico Granata
2011-02-25 22:03 ` Mauro Romano Trajber
2011-02-25 22:06 ` Daniel Baluta
2011-02-25 22:14 ` Enrico Granata
2011-02-26 4:31 ` Mulyadi Santosa
[not found] <D3CBA33B-3809-4AF5-9F66-0F2D256C4A82@cs.ucsd.edu>
2011-02-25 17:14 ` Enrico Granata
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='AANLkTiniirL=jN=yOmsev6MF3a1mpwGUkm-_Qu7zh6AR@mail.gmail.com' \
--to=daniel.baluta@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/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 NNTP newsgroup(s).