From owner-freebsd-hackers@FreeBSD.ORG Wed Jul 14 18:35:10 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 62D51106566C for ; Wed, 14 Jul 2010 18:35:10 +0000 (UTC) (envelope-from amvandemore@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1D90E8FC17 for ; Wed, 14 Jul 2010 18:35:09 +0000 (UTC) Received: by gwb15 with SMTP id 15so4677555gwb.13 for ; Wed, 14 Jul 2010 11:35:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=LZ2w01k0M0n6AWJKB/Elp6kymCX6QjEb/P5nO71kPEA=; b=jXxjVSO9PUo05MhGPAllJox/UDm9loAdydPiHf4tcFd45PhfY8rIqlfYNSephKQLNP VBZRQokKPrYv36Jl+wCZE9ZipgwXfU7DW+k6obH86sUATVcb0PQ1dKo+htscoc314pNN z0JYzNA3IOKauOugYpVqn9V3L75DFhNNDzNAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=ulCxgVZWDayylNaGvRDHk0FYT5eKZtvmvvUZD+GkGpoePvWrUJpGDy8Xm/eDGStfei UqRP6RdREmcW+1U9k3pZnDLZs/3RrHnt1HgKfE80sY9EAfh1fvlnTZRo01rR6R0H7FrE rCjKrblcUcDFpJRK/mEbVuK/L3hmYPi2Lc0Yg= MIME-Version: 1.0 Received: by 10.90.96.17 with SMTP id t17mr9672130agb.33.1279132498633; Wed, 14 Jul 2010 11:34:58 -0700 (PDT) Received: by 10.229.86.12 with HTTP; Wed, 14 Jul 2010 11:34:58 -0700 (PDT) In-Reply-To: <1007150303431.5546@smasher> References: <1007142345320.5546@smasher> <20100714144154.GB2186@britannica.bec.de> <1007150303431.5546@smasher> Date: Wed, 14 Jul 2010 13:34:58 -0500 Message-ID: From: Adam Vande More To: Atom Smasher Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-hackers@freebsd.org, Joerg Sonnenberger 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 18:35:10 -0000 On Wed, Jul 14, 2010 at 10:08 AM, Atom Smasher wrote: > On Wed, 14 Jul 2010, Joerg Sonnenberger wrote: > > On Wed, Jul 14, 2010 at 11:49:07PM +1200, Atom Smasher wrote: >> >>> the same info is available on linux via /sys and /proc and on comparable >>> hardware, i can get the info about 100x faster. >>> >> >> Are you sure that Linux is not just caching the data? I know of at least >> one system where it takes more than 100ms to query the battery state due to >> extremely slow hardware, I wouldn't be surprised if you can do worse. >> > ============== > > i don't know if linux is caching it. if it is, then freebsd should at least > have an option to do the same. the real test will be trying linux on the > freebsd hardware and freebsd on the linux hardware. i don't know when i'll > get a chance to do it, but i'll update the list with details when it > happens. > FWIW, my old dell > /usr/bin/time sysctl -n hw.acpi.battery.life hw.acpi.battery.time hw.acpi.battery.state 100 -1 0 0.01 real 0.00 user 0.01 sys -- Adam Vande More