Re: NetLoad applet problems



On Sun, 22 Nov 1998, Jeff Garzik wrote:

> You can get a lot of this stuff from ifconfig -a if a faster method,
> such as ioctls, isn't available.  ifconfig is pretty much on every
> platform, so that's a good cross-platform fallback.  The format of
> ifconfig usually differs between platform, but you can test for that
> in configure.

Not very good when speaking of performance:

1.) You need to fork() and exec() a new process each time you want
    to get new data.

2.) You need to parse the data returned from ifconfig

3.) If you look at the source code of ifconfig (net-tools 1.32 for Linux)
    you'll see that it's parsing /proc/net/dev to get statistics -
    same as what I do in LibGTop

4.) On BSD-like systems, there *is* a faster method (reading directly
    from the kernel).

So why not using the code from ifconfig in the sysdeps part of LibGTop
instead of opening a pipe. Of cause it's harder to implement, but it's
faster ...

Martin

-----------------------------------------------------------------
   Martin Baulig - Angewandte Mathematik - Universitaet Trier
   martin@home-of-linux.org, http://www.home-of-linux.org/
------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]