sysctl way too slow

Adam Vande More amvandemore at gmail.com
Wed Jul 14 18:35:10 UTC 2010


On Wed, Jul 14, 2010 at 10:08 AM, Atom Smasher <atom at smasher.org> 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


More information about the freebsd-hackers mailing list