sysctl way too slow
Dominic Fandrey
kamikaze at bsdforen.de
Wed Jul 14 13:34:02 UTC 2010
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?
More information about the freebsd-hackers
mailing list