how to benchmark the production code ?
| From: | luro at ze-ro dot net | Date: | Thu, 03 Apr 2003 16:52:04 +0000 |
| Subject: | how to benchmark the production code ? | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-4627@lists.php.net to get a copy of this message | ||
hello,
I have installed and tested the Benchmark package of Pear.
I enjoyed it and think it can be a very useful tool.
I'd like a more "high-end api" for benchmark, relying on the pear classes.
(could be evolution of the benchmark package)
Here is briefly the thing I'd like to do, but for wich I can't find a solution
(may be someone could help me) :
I'd like to implement Markers in ALL my code. But I'd like to be able to
activate or deactivate those markers because I don't want the pear classes to
work all time, but only when measures are required to solve a specific problem
that as been suspected.
I also don't want to touch the code itself.
This could be seen as a precompilation level either processing the benchmark
statement or not.
For some specific scripts there are many work around possible for that.
As an example it's possible to code the pear into specific commented tags that
could be parsed and deleted before benchmark runs.
I did this in some small tests.
I have a benchmark script that call the production script, parse the comment
and then activate benchmark statements, and finally evaluate the php code
(either with eval() or output buffering and include statements) and handle the
benchmarks results.
This is absolutely "Work Around" and it is not really clean. It may not work
for all scripts, for several reasons (include statements, path and so on ...)
Does anyone has already been looking for this kind of benchmark behaviors and
have any ideas or possible solutions ?
ze-ro