Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67048 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2428 invoked from network); 11 Apr 2013 09:47:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Apr 2013 09:47:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=laruence@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=laruence@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.215.45 as permitted sender) X-PHP-List-Original-Sender: laruence@gmail.com X-Host-Fingerprint: 209.85.215.45 mail-la0-f45.google.com Received: from [209.85.215.45] ([209.85.215.45:59704] helo=mail-la0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8E/24-14351-D9686615 for ; Thu, 11 Apr 2013 05:47:10 -0400 Received: by mail-la0-f45.google.com with SMTP id gw10so1298375lab.32 for ; Thu, 11 Apr 2013 02:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=sWr1ZeVA7x42lmQWGNzBHWBNBbotNKm7DKMDAFqqS7U=; b=fio8WQkbXFctLTtkY9YWRUH5xEn0YsgBZNXWIM5fGD49tRkN8E1cxnrQlHQZtQJAdG aJyxTDrDrdgv20RLPfmL4XA/1zE65JObx1JioX/hZO6lVAGRL6TknxL+zH9PaOTUdgy2 LnWkO+NTWXAX1E0WpJE2esShQ/RiWk7+fEjBzigwleFsLrGy2eJHMimoEvZikIzlM7li F7LYiH28mHAlHTLM+yeiZ6Tgjqe5ASiEmrmUm9FllV6JkNp63mtPn/AbRDUgT8GM2yZf MTRX70qJgQTVIy+YOgiRSJkcxSIMZkDapwHSwbtJgvjK8Fk/gsSeRJ+Ql48XpQruUwhl Hv8A== X-Received: by 10.112.125.232 with SMTP id mt8mr2896924lbb.110.1365673625976; Thu, 11 Apr 2013 02:47:05 -0700 (PDT) MIME-Version: 1.0 Sender: laruence@gmail.com Received: by 10.114.97.231 with HTTP; Thu, 11 Apr 2013 02:46:45 -0700 (PDT) In-Reply-To: References: Date: Thu, 11 Apr 2013 17:46:45 +0800 X-Google-Sender-Auth: ELQRrBLsaGTbdWD1DBduRxCL5q0 Message-ID: To: Dmitry Stogov Cc: PHP Internals , Julien Pauli , Rasmus Lerdorf , Zeev Suraski Content-Type: multipart/alternative; boundary=089e01160d605b077404da12ab1f Subject: Re: [PHP-DEV] OPcache optimizer improvement in PHP-5.5? From: laruence@php.net (Laruence) --089e01160d605b077404da12ab1f Content-Type: text/plain; charset=UTF-8 Hey; I think it's a great idea, if all op_arrays in one script share the same literals table, let's say it's main scope 's literals table. then we can make all class entry, function entry share the same constant literal.. image that, same class(function) only need to lookup once in one script.. rest will all hits cache.... I think we can gain significant peformance improve there. thanks On Wed, Apr 10, 2013 at 7:57 PM, Dmitry Stogov wrote: > Hi, > > Recently, I've found that OPcache optimizer misses a lot of abilities, > because it handles only one op_array at once. So it definitely can't > perform any inter-function optimizations (e.g. inlining). > > Actually, it was not very difficult to switch to "script at once" approach. > The attached patch demonstrates it and adds per script constants > substitution explained in the following script > > define("FOO", 1); > function foo() { > echo FOO . "\n"; // optimizer will replace it with: echo "1\n"; > } > ?> > > Of course, I ran the PHP test suite and it passed all the same tests. > Personally, I think it's safe to include this patch into 5.5 and make a > green light to some other advanced optimizations in 5.5. (e.g. conversion > INIT_FCALL_BY_NAME into DO_FCALL). > > Any thoughts? > > Thanks. Dmitry. > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Laruence Xinchen Hui http://www.laruence.com/ --089e01160d605b077404da12ab1f--