Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:60634 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49557 invoked from network); 21 May 2012 20:13:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 May 2012 20:13:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:55338] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/D5-16352-8D1AABF4 for ; Mon, 21 May 2012 16:13:12 -0400 Received: by yenm2 with SMTP id m2so5343055yen.29 for ; Mon, 21 May 2012 13:13:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding:x-gm-message-state; bh=vMnvAPZH/1boeOENpOT0aE8pKzNrgvI1w5nJQ49IKuQ=; b=EUzEwC0vNjK23h4OCTXktG83ewlRZZeByiZs33R3F2JVfHUgVBoPecouHzqQAm4Rbo MtvrCwpsXcRQDRGokZ/CDjQX6HzM+v1FBcR172pBBcr8+vNzZOlGs65mz3V3nf7jlp/l POD/hZFZxW/W3XcJzifTHrp2QYufspKHkymJhlrlpnOOi2PJANxBojZ9Z9wBWtuQHRMz AmirwfZIr6fLWWsVM3VskU8Q74OtanHnoSJH/cAGYv8n3LVtRoHIuzgphGdeCSkJyt4O 0OJ+n2UdC/RfOtmykGQh3ef9s6YbA5pH2K1UwmbW+qPPxWEi+2OrhSG+TDra+unz1Y41 pY+g== MIME-Version: 1.0 Received: by 10.236.46.74 with SMTP id q50mr24587981yhb.30.1337631189734; Mon, 21 May 2012 13:13:09 -0700 (PDT) Received: by 10.100.109.13 with HTTP; Mon, 21 May 2012 13:13:09 -0700 (PDT) In-Reply-To: References: Date: Mon, 21 May 2012 16:13:09 -0400 Message-ID: To: Tom Boutell Cc: internals@lists.php.net Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQkB0hVfJ/iNWW4LdEeGcwA8QwseTHa8/lV52S0k+jCz4TBSKEGV0wvErr5Udz5MGUZUWt0h Subject: Re: [PHP-DEV] memory usage ouchy From: tom@punkave.com (Tom Boutell) 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 wrote: > Thanks for clarifying that. Sounds like a huge win. > > On Mon, May 21, 2012 at 3:13 PM, Gustavo Lopes w= rote: >> On Mon, 21 May 2012 20:47:51 +0200, Rasmus Schultz >> wrote: >> >>> I just realized something that never occurred to me before - every >>> property is actually stored as a hash. >>> >>> This test-script will demonstrate: >>> >>> =A0[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 --=20 Tom Boutell P'unk Avenue 215 755 1330 punkave.com window.punkave.com