Re: Re: [PEPr] Comment on Networking::Monitor

From: Date: Thu, 09 Dec 2004 22:24:40 +0000
Subject: Re: Re: [PEPr] Comment on Networking::Monitor
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-34989@lists.php.net to get a copy of this message
Robert Peake wrote:
Hi Bertrand, Net_Monitor::stateDiff() does not operate at (N**2).
It does, but it's no debate, you will eat poor CPU. Indeed it should never come on very big N (Host/services to monitor) Nevertheless that with associative result array instead of flat is more related to the code's readability.
It is actually quite efficient to the task it has to accomplish and the types of arrays it is comparing. If you have an idea for how to make this method more efficient, I would be happy to review your code and benchmarks.
That was what I proposed formerly, better give you a draft of this array handling. (Now, it's no waste of time more for me anymore) And a billion bloody benchmark (excluding your disks access) I do that as it is, no changes of functions, 1,000,000 times running stateDiff() with fixed elsewhere so far as possible (to get an approach of time eated there) possibly with equal states, one or two differents ... Then I build a % version with foreach instead of each... But again associative states array is more to get the code readable. à+ -- bertrand Gugger (toggg)

« previous php.pear.dev (#34989) next »