Re:OK, here's the thing: this is only the entrance of the ra...
by lanstein on Monday October 18, 2010 @11:52PM
(#1806138)
I know PHP uses COW, so theoretically, reading from a variable should have no impact on memory usage whatsoever. This has not proven to be the case, I've called get_peak_memory_usage() and played with passing the params explicitly by reference or not. I assume it has something to do with the fact that strings/arrays are not passed by reference, and explicitly declaring the reference is cheaper sometimes and more expensive sometimes depending on refcount(maybe?)
[ Parent
| on HN ]
Re:OK, here's the thing: this is only the entrance of the ra...
by wvenable on Tuesday October 19, 2010 @12:19AM
(#1806195)
I'm not entirely sure how much I'd trust get_peak_memory_usage() for this kind of debugging. I'd be more inclined to profile this with xdebug before making these kinds of code changes.