Re: Benchmark_Memory
| From: | bertrand Gugger | Date: | Sun, 26 Mar 2006 07:10:51 +0000 |
| Subject: | Re: Benchmark_Memory | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-41979@lists.php.net to get a copy of this message | ||
Bonjour,
elias wrote:
Hi, i've build a small extension to the Benchmark package. I think it's clear what it is good for. The API is almost the same of Benchmark_Timer, in fact the most parts are c&p. You can look at it here: http://adaptiveinstance.com/pear/Benchmark_Memory/ If it is wanted, it would be fine if someone can add it to Bechmark package, but i can do it myself with an account. ;) elias As Sebastian hang me over Benchmark, my intention was to extend it to report all possible resources usages.So memory usage is naturally fundamental here. However, I was not planning to extend it this way. If you consider your code, it's a simple duplication of the existing Timer class. In fact you could quite extend the Timer class and just overwrite / add few methods. Some consequences: * cannot profile both elapsed time and memory * worse, does not provide any way of future extensions * cannot be used in Iterate * no cumul possible as does Profiler It's again some "horizontal" extension , we need more some reorganization of the objects Benchmark deals with. Could even be by using some external packages for the rendering for example. My direction was more some http://toggg.com/Performer/ But this project needs work around to be full usable. Between else, * the sectioning definition is to be reconsidered, * I would like to propose an option to only do the snaps and send them in a socket. So, the benchmarking would alter a minimum the observed application and also, monitoring could be done online. * not only for that, but the whole should be refactored to separate what is the real snap (as setMarker()) , from the store/analyze of them and from the rendering. In fact, it's more some profiling tool needed, for example for memory consumption, it's interesting to see what classes/methods/functions consume or give back the memory. See http://toggg.com/pear/memory.html which was quick established on this model as we were hunting memory consumption by pear-1.4.0 development. I used http://toggg.com/Performer/clonCla.phps.html to clone the whole pear-core : encapsulating each function and extending each class so to get some calls to memory usage, before and after each function/method call. As said, it's very raw as developped in some urgence situation but it's going in the same direction. To conclude, I'm not opposed to this extension, as say , a light memory usage checker, but I would largely prefer the class structure to be first reorganized. Once we accord on a better definition, I would not be opposed to welcome you by the team if you get some time to put in the project. Thus Anant told me he could do it and I'm naturally available too. But first, better define the stuff :) Sorry for this funny english, don' t hesitate to ask precisions if it's too confused. -- toggg