Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88923 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71901 invoked from network); 23 Oct 2015 07:31:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2015 07:31:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=cornelius.howl@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cornelius.howl@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.48 as permitted sender) X-PHP-List-Original-Sender: cornelius.howl@gmail.com X-Host-Fingerprint: 209.85.218.48 mail-oi0-f48.google.com Received: from [209.85.218.48] ([209.85.218.48:34356] helo=mail-oi0-f48.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F4/31-56439-852E9265 for ; Fri, 23 Oct 2015 03:31:37 -0400 Received: by oies66 with SMTP id s66so61284519oie.1 for ; Fri, 23 Oct 2015 00:31:34 -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=fe89HtbGzLqriz7Y7pWSrsF1DKJvfSd9A5AYO9q1H5k=; b=CI1k9Gf5s3xnLrRFVwQppd6Us/V4/e9bVve4Qf0P4LtfDXcOKGtQtTbxy+4q4HaSIs yLhBWNJHVCmRvTbHIfRkGikfLd9hf8Qo0g+DFawICKLLJ4sRg8qNO85N6XAUF0Th3rKl nBPvsKmri7TxPEBMScXkNFbvrE2fvThkXUIEjvBmuqw1y0SeUI6z4DaMAIAvs2uHFb4M o3cjn9AkLc0MHWqTvV6CwKFFg49bxZXH2k7ZmpPb1anM2fE/6NEanHZbPdfaRxS8y/EF 9pXg0aEOlUICo2Fibyb9HpxcW6I8o/r4PAkPqwDln+aVkRyujiQw8J6rZeCuKemqPeTW Ho3g== MIME-Version: 1.0 X-Received: by 10.202.205.195 with SMTP id d186mr13292598oig.1.1445585494303; Fri, 23 Oct 2015 00:31:34 -0700 (PDT) Received: by 10.76.157.138 with HTTP; Fri, 23 Oct 2015 00:31:34 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2015 15:31:34 +0800 Message-ID: To: Dmitry Stogov Cc: Laruence , Derick , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a1135263ce169370522c09990 Subject: Re: [PHP-DEV] few questions about op_array From: cornelius.howl@gmail.com (Lin Yo-An) --001a1135263ce169370522c09990 Content-Type: text/plain; charset=UTF-8 Hi Dmitry, I changed and tested it, and it looks like it gains some improvements. how do you compare the benchmark result? is there a tool doing it? I currently do: ./sapi/cli/php Zend/bench.php The result: https://gist.github.com/4bbc33b7b5dcedc6bd66 On Fri, Oct 23, 2015 at 12:39 AM, Dmitry Stogov wrote: > > On Oct 22, 2015 3:45 PM, "Lin Yo-An" wrote: > > > > Hi all, > > > > > > I am looking into zend op_array structure, and few questions raised in > my mind: > > > > 1. Why op_array->refcount uses *uint32 instead of uint32, is there a > reason? if we can replace it with uint32, then we might save one emalloc > call for memory allocation for every op_array allocation? > > We may have few different op_array structures with the same opcodes but > with different names for example. So just uint32won't work. > > > > > 2. There are also a lot of information saved in the op_array structure, > if we can move line_start, line_end, doc_comments...etc into an external > structure, then we might be able to reduce the op_array size and decrease > the cache miss? is it doable? > > I'm not sure if patritioning data of op_array, into frequntly and rarely > used, may make any significant difference. Because we usually work only > with a single instance of op_array in each moment. Fields reordering alrecy > helped to reduce cache-misses. But I may be wrog :) > > Thanks. Dmitry. > > > > > > > > > Cheers, > > Yo-An Lin > > https://github.com/c9s > > > -- Best Regards, Yo-An Lin --001a1135263ce169370522c09990--