Include memory information when outputting Hoa\Bench.
This is a feature request. We're using Hoa\Bench to measure how slow we are for a number of things.
We manually also output PHP memory right at the bottom, as you can see here:
https://github.com/fruux/sabre-vobject/blob/master/bin/bench_freebusygenerator.php#L61
I was wondering if this could also be a good Hoa\Bench built-in feature =)
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
Measuring PHP memory is something really hard… I tried several times but without success :-/. The memory_* functions are not accurate since they are based on the memory allocated by the VM, not the current program. /cc @hoaproject/hoackers
I guess for my use-case, accuracy is not the most important. Relative accuracy is. If I see a great increase in memory usage, the number is not as important as the fact that memory usage did increase. This is how I very recently discovered a big memory leak.
I'd actually suggest using the xdebug_ methods though.
@evert If ext/xdebug yes, we could fallback to it. So, ok. Any volunteers in the @hoaproject/hoackers community?
:+1:
Hoa\Bench allow the possibility to make a pause during the process. But, memory benchmark will can't be paused.
That's correct. We are not going to be able to pause the memory, but does it make sense after all? We land and start a new mark. We pause it, we unpause it later and we end it. What does it mean in term of memory? Just nothing. We can record the memory (and memory peak) on start and stop/pause, but when we unpause, what can we do? We could work relatively (total memory used = memory at time B - memory at time A + m_D - m_C).
Thoughts?
Or… we can attach the memory information to the __global__ mark, which is started and stopped before and after all marks (thanks @camael24 for this feature!). It would make more sense.
The real answer is: @evert, does it answer to your needs?
In the particular case I was looking at, knowing it globally would definitely help. But a peak/current memory usage after stop() would probably be useful in the future as well. Even if tests can be paused, this would at least give some sort of indication where it went wrong.
@evert: Correct. In all cases, the __global__ mark is a regular one, as all the others.
So, any volunteers @hoaproject/hoackers? Maybe @evert, @vonglasow or @camael24?
@dantleech Can you help us here please? I reckon your experience on PHPBench can be useful.
PHPBench simply disables GC and records memory_get_peak_usage (here].
@dantleech Since Hoa\Bench can put marks in pause, how do you think it can be applied on memory usage?
@dantleech ping ?
@vonglasow I am assigning this issue to you. Is it OK?
@Hywan yes ok