Re: sysctl way too slow

2010-07-14 Thread Anonymous
Atom Smasher writes: > http://smasher.org/tmp/zsh-bsd-sysctl-slow.png > > is there a way to get this information that doesn't take so long? If you only need sysctl values for fancy prompt then cache them inside variables, e.g. PROMPT='($hw_acpi_battery_life, $hw_acpi_battery_time, $hw_acpi_b

Re: sysctl way too slow

2010-07-14 Thread Atom Smasher
On Wed, 14 Jul 2010, Ed Schouten wrote: So what about other sysctls? Is it just these sysctls? It may be the case that these values are not simply read from some variable in the kernel, but really performs some hardware calls. Still, 436 msec is quite a lot of time. === getti

Re: sysctl way too slow

2010-07-14 Thread Adam Vande More
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 fas

Re: sysctl way too slow

2010-07-14 Thread Atom Smasher
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

Re: sysctl way too slow

2010-07-14 Thread Dan Nelson
In the last episode (Jul 14), Joerg Sonnenberger said: > 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 th

Re: sysctl way too slow

2010-07-14 Thread Atom Smasher
On Wed, 14 Jul 2010, Dominic Fandrey wrote: 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

Re: sysctl way too slow

2010-07-14 Thread Joerg Sonnenberger
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 10

Re: sysctl way too slow

2010-07-14 Thread Dominic Fandrey
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 ab

Re: sysctl way too slow

2010-07-14 Thread Ed Schouten
* Atom Smasher wrote: > http://smasher.org/tmp/zsh-bsd-sysctl-slow.png > > 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. So what about other sysctls

Re: sysctl way too slow

2010-07-14 Thread Hans Petter Selasky
On Wednesday 14 July 2010 13:49:07 Atom Smasher wrote: > http://smasher.org/tmp/zsh-bsd-sysctl-slow.png > > 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 fast

sysctl way too slow

2010-07-14 Thread Atom Smasher
http://smasher.org/tmp/zsh-bsd-sysctl-slow.png 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. thanks... -- ...atom