Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:78936 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 52275 invoked from network); 18 Nov 2014 09:40:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2014 09:40:29 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.220.181 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.181 mail-vc0-f181.google.com Received: from [209.85.220.181] ([209.85.220.181:33335] helo=mail-vc0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4F/88-06780-B041B645 for ; Tue, 18 Nov 2014 04:40:29 -0500 Received: by mail-vc0-f181.google.com with SMTP id le20so5551382vcb.26 for ; Tue, 18 Nov 2014 01:40:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=EBHz6ahNUW08mzGaKNv4qZUQFxWHhTZco1y9XoWDnv4=; b=crRf2OxnWCqsFzvc2UQpmLuDjPtku13bYjJjdP5QuMZCFX5U1j7EjVtOYweDK9cQGB ib5u5REiz4MiqhA5QGdJCyQtaHtGt/9F4wWcUe/x8ED8IwFzbUsQb3wPhCzvJZN9zFaF PRrErn1NIEtRaGeJmY4YSmn4pIuLHF5wmSevxwp4zh9lFnFHaoacNQvS4nIlz1MRcnnT NsQwVjsuJuXA/P6ff3KjPaLWfwsf9FLOTqIOdJo59OjapYW9CUnzvSfz+a7DbHdBq9Ff 27BMGL1Z5mmIXQqPXTYZYiTY0co+6r5mNNTQdB9lsDZM/Hk283ZPHJNK0QTgFwE4Y8qj vuOA== X-Gm-Message-State: ALoCoQlkrSpquPQlLuITBTW/FBVQsJNIGkw5fsXEDNnwoqJ1NsLiDp+qRF2DHoxPG9UklhbW+PpKMCfmPyBylte4/sRZrv/7u3VWUnwVam1tdSB71QFl5B+U1kq+6v9kyEc/Zuv8SSOfETTRujcP5bQRydK7+y4m8Q== MIME-Version: 1.0 X-Received: by 10.52.145.201 with SMTP id sw9mr25930786vdb.5.1416303625088; Tue, 18 Nov 2014 01:40:25 -0800 (PST) Received: by 10.52.176.231 with HTTP; Tue, 18 Nov 2014 01:40:25 -0800 (PST) In-Reply-To: <546ADD8A.20400@gmail.com> References: <546ADD8A.20400@gmail.com> Date: Tue, 18 Nov 2014 13:40:25 +0400 Message-ID: To: Stanislav Malyshev Cc: Xinchen Hui , Xinchen Hui , Nikita Popov , Anatol Belski , PHP Internals Content-Type: multipart/alternative; boundary=bcaec52d57cb77eda505081ee2e6 Subject: Re: [PHP-DEV] Re: Use zend_string* for op_array->arg_info[].name and class_name From: dmitry@zend.com (Dmitry Stogov) --bcaec52d57cb77eda505081ee2e6 Content-Type: text/plain; charset=UTF-8 Of course, it would be great to always use zend_string, but only arg_info duplication (without char -> zend_string) would add ~90KB on 32-bit system and ~150KB on 64-bit system per process. So I expect 300-500KB wasted per process. Actually, only inheritance and reflection code was complicated by the patch (not significantly). Thanks. Dmitry. On Tue, Nov 18, 2014 at 8:47 AM, Stanislav Malyshev wrote: > Hi! > > >> we only need do it in master process, and mark as interned(with hash > >> precalculated), no write will be happened, so thanks to COW on fork, we > >> won't need lots of extra memory. > >> > > > > It's not true for Windows. > > On Linux we would copy arg_info from shared read-only segment into > process > > heap memory, then some blocks may be COW or not depended on luck. > > How bad would it be? Given that significantly simplifies the code, and > does not require to check and write two branches each time we deal with > arginfo, maybe it is worth to spend some memory (given that we only > spend it once on init)? > --bcaec52d57cb77eda505081ee2e6--