Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:88925 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87621 invoked from network); 23 Oct 2015 12:28:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Oct 2015 12:28:08 -0000 Authentication-Results: pb1.pair.com header.from=laruence@php.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=xinchen.h@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.42 as permitted sender) X-PHP-List-Original-Sender: xinchen.h@zend.com X-Host-Fingerprint: 209.85.213.42 mail-vk0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:36146] helo=mail-vk0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id ED/B2-56439-4D72A265 for ; Fri, 23 Oct 2015 08:28:05 -0400 Received: by vkex70 with SMTP id x70so62826910vke.3 for ; Fri, 23 Oct 2015 05:28:02 -0700 (PDT) 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:from:date :message-id:subject:to:cc:content-type; bh=Im3YVG0LiW+hKaJQgE2K9ZLAxTaMKv+CFRwVF47zDb0=; b=i9o8bZKXTIE1YnHQjKHF6S78qfYB8YyPoD1Vo8daEkiJL5GdPRGi30pZRVrnRfFDSg V0RWPLkSE2mpaTY3UIqVZsulfsx8fMom6+xgmTJPp7p0FpXKGQDmnZdqu2lugGa/OaVI nbwJWKpOpvnlDoC+TWnMzp32oKhP4HeymsNwHD1RyvH0IGAeSQbAVfHZkgifGoGdGpjo FgoL9cWppQ1zyodThGSRxtz1sWOIDS2/4HxILi9ywe9ilrzAlLLLwPqvX+TeReamsMQc RndQRRfrJvonYEqSl0iriZS1pHUL7VbiPU/zr/OfXvJkCQc8LQ1RzYqLg9DZawevxluU 5stw== X-Gm-Message-State: ALoCoQnumT+1dezDWG6ff+TV/Gs+NmzQBjrWssPeKPfDG5LptR7awJoEkIuNHWRWVWEDuRtTvEQO2jdJhgWadHADf43OFEp2+SM7UIhLK40OujtqG7rPTGPI3zjJL+ltIq/jP/nd+8uCk7LC2qB5DLiBrg5b3RFLpClk4pwF283aEEW4P9LIwIA= X-Received: by 10.31.48.73 with SMTP id w70mr12107404vkw.138.1445603281866; Fri, 23 Oct 2015 05:28:01 -0700 (PDT) Received: from mail-vk0-f48.google.com (mail-vk0-f48.google.com. [209.85.213.48]) by smtp.gmail.com with ESMTPSA id c69sm3138974vke.21.2015.10.23.05.28.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Oct 2015 05:28:00 -0700 (PDT) Received: by vkgs66 with SMTP id s66so2889599vkg.1 for ; Fri, 23 Oct 2015 05:28:00 -0700 (PDT) X-Received: by 10.31.130.9 with SMTP id e9mr7659800vkd.78.1445603280360; Fri, 23 Oct 2015 05:28:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.229.3 with HTTP; Fri, 23 Oct 2015 05:27:41 -0700 (PDT) In-Reply-To: References: Date: Fri, 23 Oct 2015 20:27:41 +0800 Message-ID: To: Lin Yo-An Cc: Dmitry Stogov , Derick , PHP Developers Mailing List Content-Type: multipart/alternative; boundary=001a1145a428032c200522c4be46 Subject: Re: [PHP-DEV] few questions about op_array From: laruence@php.net (Xinchen Hui) --001a1145a428032c200522c4be46 Content-Type: text/plain; charset=UTF-8 Hey Lin: On Fri, Oct 23, 2015 at 3:31 PM, Lin Yo-An wrote: > 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 > Acutally, simply bench.php testing is very un-stable. in generally, we prefer using real-life app to test, like wordpress. Basically, we use callgrind to collect the IRs , like valgrind --tool=callgrind --instr-atstart=yes php-cgi -T 100 wordpress/index.php ( I may type args wrong). But in this case(cache friendly), you may try to use perf to collect cache miss changing. thanks > > > > 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 > -- Xinchen Hui @Laruence http://www.laruence.com/ --001a1145a428032c200522c4be46--