From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 14 13:34:01 2010 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 E69901065676 for ; Wed, 14 Jul 2010 13:34:01 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.bsdforen.de (bsdforen.de [212.204.60.79]) by mx1.freebsd.org (Postfix) with ESMTP id A81298FC17 for ; Wed, 14 Jul 2010 13:34:01 +0000 (UTC) Received: from mobileKamikaze.norad (vpn-cl-164-138.rz.uni-karlsruhe.de [141.3.164.138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bsdforen.de (Postfix) with ESMTP id 9FF058A21A9; Wed, 14 Jul 2010 15:34:00 +0200 (CEST) Message-ID: <4C3DBCC7.8060500@bsdforen.de> Date: Wed, 14 Jul 2010 15:33:59 +0200 From: Dominic Fandrey User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-GB; rv:1.9.1.10) Gecko/20100627 Thunderbird/3.0.5 MIME-Version: 1.0 To: Atom Smasher References: <1007142345320.5546@smasher> In-Reply-To: <1007142345320.5546@smasher> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: sysctl way too slow 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: Wed, 14 Jul 2010 13:34:02 -0000 On 14/07/2010 13:49, Atom Smasher wrote: > http://smasher.org/tmp/zsh-bsd-sysctl-slow.png Why use a screen shot here? > is there a way to get this information that doesn't take so long? > > the same info is available on linux via /sys and /proc and on comparable > hardware, i can get the info about 100x faster. It probably depends on your BIOS. This is the same call on my system: % time sysctl -n hw.acpi.battery.life hw.acpi.battery.time hw.acpi.battery.state 100 -1 0 sysctl -n hw.acpi.battery.life hw.acpi.battery.time hw.acpi.battery.state 0.00s user 0.01s system 96% cpu 0.013 total As you can see 33 times faster than on your system. I agree that 0.413 seconds is too long, but I don't think it makes sense to call this value more frequently than every 30 seconds. So I'd say it's more of an annoyance than a real problem. Regards -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?