Date: Tue, 20 Oct 2009 22:27:36 +0200 From: Ivan Voras <ivoras@freebsd.org> To: Roman Divacky <rdivacky@freebsd.org> Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete Message-ID: <9bbcef730910201327h3bbcc526ja7a8283addfe2667@mail.gmail.com> In-Reply-To: <20091020171354.GA92192@freebsd.org> References: <20091020122432.GA50817@ravenloft.kiev.ua> <hbkb79$7l2$1@ger.gmane.org> <20091020171354.GA92192@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
2009/10/20 Roman Divacky <rdivacky@freebsd.org>: > On Tue, Oct 20, 2009 at 02:42:17PM +0200, Ivan Voras wrote: >> Alex Kozlov wrote: >> >> >Of course ps or top output much more convenient, but if setproctitle so >> >expencive and will be called so often, then SIGINFO may be good >> >compromise. >> >> Regarding speed of setproctitle(), here are some microbenchmark results >> from the attached test source: >> >> getpid: 3661124.75 iterations/s >> setproctitle: 591357.56 iterations/s >> >> Meaning, setprocitle() is around 6 times more expensive than getpid(), >> meaning it can only be pulled off nearly 600,000 calls/s on a 2.3 GHz >> Core 2 CPU. > > what about contention? setproctitle() is an sysctl so it will prevent > other sysctl's from working when being executed.. Others sysctls... for that particular process (since it modifies process-global data) which happens to be single-threaded :P
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9bbcef730910201327h3bbcc526ja7a8283addfe2667>