Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:84469 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 71482 invoked from network); 9 Mar 2015 12:47:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Mar 2015 12:47:30 -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.178 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.220.178 mail-vc0-f178.google.com Received: from [209.85.220.178] ([209.85.220.178:49512] helo=mail-vc0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 84/1F-29848-1669DF45 for ; Mon, 09 Mar 2015 07:47:29 -0500 Received: by mail-vc0-f178.google.com with SMTP id id10so9690241vcb.9 for ; Mon, 09 Mar 2015 05:47:27 -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:date :message-id:subject:from:to:cc:content-type; bh=iAHfvUDIuKgW+zJdo+cgEs4Dg38EbTKUT5VQMJwx/RE=; b=W3HYz/uueigzHeUtpvoOOn4ZN9AyFZzdaKbW+3WBh/IbmfZ6kBBA6n3GoOeOc61Aus oVJB/gQF0ByQj82CSDh8bjg8MXtZpRf4RkTlwbDoBPS3//T5a541Su7sSmjLw8ZBtxMI 51c9p/vdr8ImqMAR6DvE9Y3BicZbRP5ESXseGMG6NrIlGWfEEk3LQTws1vEhGnPhfU3R wNaFodgvFalh8mZP6vRen/awww+y+u1grEiDhZpPl8mzbPlEgRYmiTNY4FKYWWxtw9p3 UF0bDnMQjYJMNZXao6QuOThUbn20pZ6jR8UBUHithYgDm4D7GEWpk/mWSK9IxXWBT1VU w9bA== X-Gm-Message-State: ALoCoQl5SgSYcJfhvnBid+7u81Ndh3f75O1Jrim56Ir7TSR6jOPAinXyNj/lQ30S/sWg6Uehq4ucFyIBL7GL+83WRztwxYxMBVCnieASDvJvkkKQ28Wr14k5p+lxdvcto6gFNItrpXBRqJ0kKB+g5WMG4Bba1W660g== MIME-Version: 1.0 X-Received: by 10.52.165.97 with SMTP id yx1mr13966744vdb.5.1425905247100; Mon, 09 Mar 2015 05:47:27 -0700 (PDT) Received: by 10.52.113.231 with HTTP; Mon, 9 Mar 2015 05:47:26 -0700 (PDT) Received: by 10.52.113.231 with HTTP; Mon, 9 Mar 2015 05:47:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 9 Mar 2015 15:47:26 +0300 Message-ID: To: Derick Cc: PHP Internals , Bob Weinand , Xinchen Hui Content-Type: multipart/alternative; boundary=001a11c28becbcb9df0510da6f0a Subject: Re: [PHP-DEV] About optimization for compiler From: dmitry@zend.com (Dmitry Stogov) --001a11c28becbcb9df0510da6f0a Content-Type: text/plain; charset=UTF-8 On Mar 9, 2015 1:24 PM, "Derick Rethans" wrote: > > On Fri, 27 Feb 2015, Xinchen Hui wrote: > > > Hey Internals: > > > > I was looking Bob's switch optimization.. > > > > then I start to worry about where is the place optimization should goes.. > > > > in generally, PHP is a interpreted language. IMO, it should > > compiler the PHP codes to opcode without any optimization(of course, > > we did some, but they won't change a lots of opcodes which should be > > generated).. > > > > and, since 5.5, we already have opcache bundled in.. > > > > thus, I am proposing a principle, that is: > > > > in the future, we only do optimization in opcache side, and keep > > Zend Compiler without any optimization... considering Zend Compiler do > > things in -O0. > > > > since, optimization always are dangerous.. if we only do them in > > opcache, user can still run them codes with disable opcache, or at > > least disable some optimization level which cause that.. > > > > what do you think? > > I think it's a very sensible approach. I would however like to see this > sort of 'experimental' optimisations to be also possible through an > extension. I think some of Sara's? AST hooks might help here? AST may be siutable only for very basic optimisations. Opcache already implements optimisations on top of Control Flow Graph, but they take significant time. Without opcache they would slowdown execution instead of speedup. During work on JIT we developed a more smart framework for optimization based on Extended Static Single Assignment form. I think in the future we will able to get gain from it even without JIT. Thanks. Dmitry. > > cheers, > Derick --001a11c28becbcb9df0510da6f0a--