Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67029 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96735 invoked from network); 10 Apr 2013 13:24:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Apr 2013 13:24:30 -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.215.49 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.215.49 mail-la0-f49.google.com Received: from [209.85.215.49] ([209.85.215.49:60797] helo=mail-la0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 38/B1-21449-D0865615 for ; Wed, 10 Apr 2013 09:24:30 -0400 Received: by mail-la0-f49.google.com with SMTP id fs12so423750lab.8 for ; Wed, 10 Apr 2013 06:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=naMFNRmzYAuIdCKkd5XClBkEhJLmAc086dSe9uAvpOg=; b=VcsoojMgXQoDKzgDbkU+I7VAWtuQS7OPlirjqwM0H6JrYyjj8hcEI4tME9PyGfEeVU QIYH3aep1R926+khnSBZV9/6ZWzlRy+OGna5VCMcMfxmE38+FVMwd3UmKX2qvXoknrln qsCNJWFUSkEcO7opxOgPqwd/+2yFVAnjIIburpQv0sQAhuldO9Zf3aJ6uxvoOyOUc9ne EXlFGWuoaKw4YyPr1TbQFjuAfbXys+1onCgIKzqB1N9RJOX/3t/M5U58fNA5veu52POF 4mSOOhYi4f/aWrIg9L6UdXgw8f6ylmJIYcdaBYLM7px7P5yvHjCH7dDX6aIKZGAtYTNa GYJw== MIME-Version: 1.0 X-Received: by 10.152.104.80 with SMTP id gc16mr1017847lab.49.1365600267176; Wed, 10 Apr 2013 06:24:27 -0700 (PDT) Received: by 10.112.163.40 with HTTP; Wed, 10 Apr 2013 06:24:27 -0700 (PDT) In-Reply-To: References: Date: Wed, 10 Apr 2013 15:24:27 +0200 Message-ID: To: Dmitry Stogov Cc: PHP Internals , Julien Pauli , Rasmus Lerdorf , Zeev Suraski Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] OPcache optimizer improvement in PHP-5.5? From: pierre.php@gmail.com (Pierre Joye) hi Dmitry, On Wed, Apr 10, 2013 at 1: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? Mixed feeling, I like this "simple" optimization and the possible gains but 5.5 is very closed from RC. Cheers, -- Pierre @pierrejoye