Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74237 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32047 invoked from network); 15 May 2014 20:35:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 May 2014 20:35:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.53 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.53 mail-qg0-f53.google.com Received: from [209.85.192.53] ([209.85.192.53:35338] helo=mail-qg0-f53.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/F2-14382-60525735 for ; Thu, 15 May 2014 16:35:19 -0400 Received: by mail-qg0-f53.google.com with SMTP id f51so2628204qge.40 for ; Thu, 15 May 2014 13:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=OuZUwBFYKZk91wwXkmGIt7OF4XSJx8MebTvrYFedHCQ=; b=ywdCnEK3ym1ULNBJqHkjqKfoKhOLIPmAUX2RrgodaXiPGL68F/jRK5F+t7d0E5trA+ KGILI6g+SHFM/amfBr8lOhsbGX2MvoTjtuNH/fTh1iQIOEHGpsfgV6SiLMIts0eHwKA2 tltI7w4HhiuOTVo8l6tqo+1hNN0Eefvm4EwMy1tk3NGNLPsJI9+dAVrK1yHJV7teocLL vU/j9XNc59UU6EWKShUjOXNOSjkyymzkhT/+548PH8W3m6R/bfI9aldTc1o7/4h9RCS3 noV+i/JeeOsl6iNBI+2szg8UmKJM4ilmVeg4Gv4mnTZP1daKeNNWCRMjk0hiNN41mmPm QyBQ== MIME-Version: 1.0 X-Received: by 10.140.101.99 with SMTP id t90mr6856922qge.115.1400186116078; Thu, 15 May 2014 13:35:16 -0700 (PDT) Received: by 10.140.47.231 with HTTP; Thu, 15 May 2014 13:35:16 -0700 (PDT) In-Reply-To: <53750C90.5070200@marc-bennewitz.de> References: <53750C90.5070200@marc-bennewitz.de> Date: Thu, 15 May 2014 22:35:16 +0200 Message-ID: To: Marc Bennewitz Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [rfc] 64bit usage, actual memory usage using real life apps From: pierre.php@gmail.com (Pierre Joye) On Thu, May 15, 2014 at 8:50 PM, Marc Bennewitz wrote: > Even 4% is very big if you provide a high performance web application. 4% memory increase? Not really. >> There is indeed more memory used but it is less than one could expect >> and very acceptable given the benefits provided by the patch. >> >> Also we may see more gains if class/variable/etc names use int32 >> instead of size_t, as Stas pointed out it makes little sense in this >> case and the implementation is much safer than any other areas in the >> core (or other extensions). >> >> I feel confident that we can even get better results with phpng, once >> we get the time to actually merge the 64bit patch and do further >> analyzes while stabilizing phpng. >> >> I have to ask anyone to actually look at these numbers and the >> benefits (see the other thread "on memory usage with the 64bit patch, >> and interpretation of various numbers"). > > > Pierre, I don't understand you in the following points: > > You argument the size_t for string length is to use well defined C types and > that makes it more safe. But it is only an integer type that can overflow in > the same way any other integer can do. And as Nikita pointed already the > type exists to support ALL possible objects. > In which case it makes it more save? Please see the links in the other thread, it is very well explained, much better that what I could do. > Why you think the size_t type is more safe for string length but in the case > for class names it's ok to use a smaller type? Because we already have safety checks for string lengths etc. We also already had issues related to this area. Take it as a compromise, but still safe (while phpng may bring its lot of issues too, but that's expected). > I often hear in this thread (and phpng) we do support string length up to > 2GB on 32bit systems already and therefore should increase it for 64bit > system to the max possible value. > In my opition it's simply not true in practice because on 32Bit systems your > system can manage max. 2^32bytes and one PHP process isn't the only process. > I think the same argment exits on 64bit system. > So for me we should reduce the max. string length down as nobady can use 2GB > strings in PHP regardless what integer type string length will be ;) I do not care much about the 2G+ limit, as I said already multiple times it is a side effect of this patch, not a goal. > Same for class names which shouldn't be possible to be longer than 255. 255 is not enough, but yes, we do not even need 2G :) Cheers, -- Pierre @pierrejoye | http://www.libgd.org