From owner-freebsd-hackers@FreeBSD.ORG Tue Oct 20 17:33:21 2009 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D0F1106566B; Tue, 20 Oct 2009 17:33:21 +0000 (UTC) (envelope-from rdivacky@vlk.vlakno.cz) Received: from vlakno.cz (77-93-215-190.static.masterinter.net [77.93.215.190]) by mx1.freebsd.org (Postfix) with ESMTP id 1533E8FC1A; Tue, 20 Oct 2009 17:33:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 714959CB068; Tue, 20 Oct 2009 19:14:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at vlakno.cz Received: from vlakno.cz ([127.0.0.1]) by localhost (lev.vlakno.cz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iH6Id6IgtVqv; Tue, 20 Oct 2009 19:13:55 +0200 (CEST) Received: from vlk.vlakno.cz (localhost [127.0.0.1]) by vlakno.cz (Postfix) with ESMTP id 09FD79CB513; Tue, 20 Oct 2009 19:13:55 +0200 (CEST) Received: (from rdivacky@localhost) by vlk.vlakno.cz (8.14.3/8.14.3/Submit) id n9KHDscm092615; Tue, 20 Oct 2009 19:13:54 +0200 (CEST) (envelope-from rdivacky) Date: Tue, 20 Oct 2009 19:13:54 +0200 From: Roman Divacky To: Ivan Voras Message-ID: <20091020171354.GA92192@freebsd.org> References: <20091020122432.GA50817@ravenloft.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: freebsd-hackers@freebsd.org Subject: Re: Make process title - % complete X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 17:33:21 -0000 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..