Re: cvs: php-benchmarks /benchcli/tests test_whirl.php /benchcli/tests/phpWhirl 99bottles.wr AUTHORS COPYING keymaker.wr whirl.php
/benchcli/tests/phpWhirl/classes WhirlMathRing.php WhirlMemory.php WhirlOpsRing.php WhirlParser.php WhirlRing.
| From: | Alexander Hjalmarsson | Date: | Wed, 03 Jun 2009 16:33:12 +0000 |
| Subject: | Re: cvs: php-benchmarks /benchcli/tests test_whirl.php /benchcli/tests/phpWhirl 99bottles.wr AUTHORS COPYING keymaker.wr whirl.php /benchcli/tests/phpWhirl/classes WhirlMathRing.php WhirlMemory.php WhirlOpsRing.php WhirlParser.php WhirlRing. |
||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-65067@lists.php.net to get a copy of this message | ||
On Wed, Jun 3, 2009 at 2:04 AM, Paul Biggar <paul.biggar@gmail.com> wrote:
> On Tue, Jun 2, 2009 at 9:13 PM, Nuno Lopes <nlopess@php.net> wrote:
> >> For memory allocation:
> >
> > Let me just add a few more options:
> > - valgrind has a tool named helgrind, which is a heap profiler
>
> (I presume you mean massif?)
>
> Hmmm. I had suggested that Alexander use the "memory allocated"
> statistic of valgrind as a surrogate for the data provided by massif.
> Massif reports the memory used at certain intervals, which is probably
> the ideal result: the sum of the memory reported every 1/X seconds.
>
> The problem was the valgrind is too slow, and massif is probably
> slower (but I am not sure). I think using a profiling malloc library
> would be faster, but I'm not sure what the options are here.
>
The massif tool is actually faster. On my machine I get these time results
from ackermann:
valgrind (with memcheck): 134s
valgrind (with massif) : 31s
Without profiler: : 2.8s
This shows that massif would be about 15x slower (their documentation says
about 20x). Memcheck is almost 50x slower than "just php" in my case, but
their doc says 10x-30x.
Source: http://valgrind.org/info/tools.html
I don't know how much "lower" then 15x you can get without using things such
as memory_get_peak_usage and stuff. A good thing when using valgrind is that
the user could choose whether to use more advanced features or use memheck.
I do think that the majority of the users who want to use the benchmark
program to bench their scripts actually would like the output that are
produced by those tools to see where improvements are needed.
I'm pretty confused of which tool to choose, but I don't think that it would
be a waste of time implementing some kind of valgrind usage, would it? I
believe there would be people using it in at least some cases. If we find
any better way of just reporting memory usage, we can include that as well.
I read about the /proc/pid/statm but it looks like that info shouldn't be
used, after some googling.
Anyway, if we implement valgrind or any other profiler, how should the input
be parsed? I believe the best way would be to parse the important results
(like total memory usage) and also save the original output file produced
from the tool, so a user can do whatever he likes with the original results
as well.
Regards
Alexander
>
>
> > - Zend's memory allocator provides some statistics, including the
> user-land
> > function: http://php.net/memory_get_usage
>
> For the reasons above, I don't think this (or memory_get_peak_usage)
> is suitable.
>
>
> Thanks,
> Paul
>
>
>
>
> --
> Paul Biggar
> paul.biggar@gmail.com
>
> --
> PHP Quality Assurance Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>