Re: memory usage ouchy
| From: | Tom Boutell | Date: | Mon, 21 May 2012 20:13:09 +0000 |
| Subject: | Re: memory usage ouchy | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60634@lists.php.net to get a copy of this message | ||
I ran this script on 5.3.13, and it reported:
786432 bytes used
On 5.4.3, it reported:
262144 bytes used
That is definitely a significant improvement.
Objects are still a lot bigger than their contents. I don't expect
they would ever shrink to the size of their contents exactly or even
all that close of course.
On Mon, May 21, 2012 at 3:25 PM, Tom Boutell <tom@punkave.com> wrote:
> Thanks for clarifying that. Sounds like a huge win.
>
> On Mon, May 21, 2012 at 3:13 PM, Gustavo Lopes <glopes@nebm.ist.utl.pt> wrote:
>> On Mon, 21 May 2012 20:47:51 +0200, Rasmus Schultz <rasmus@mindplay.dk>
>> wrote:
>>
>>> I just realized something that never occurred to me before - every
>>> property is actually stored as a hash.
>>>
>>> This test-script will demonstrate:
>>>
>>> [snip]
>>
>>
>> The test-script contains no information about the version of PHP you're
>> using. Starting with PHP 5.4, the properties hash table is only created if
>> you're storing dynamic properties (i.e. assigning undeclared properties) or
>> if it otherwise requested. Otherwise, they're stored in an array.
>>
>> --
>> Gustavo Lopes
>>
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
> Tom Boutell
> P'unk Avenue
> 215 755 1330
> punkave.com
> window.punkave.com
--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com