Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:96231 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83425 invoked from network); 4 Oct 2016 16:40:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Oct 2016 16:40:26 -0000 Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.20 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.20 mout.gmx.net Received: from [212.227.17.20] ([212.227.17.20:55704] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D1/48-06241-97BD3F75 for ; Tue, 04 Oct 2016 12:40:26 -0400 Received: from [192.168.2.103] ([79.243.112.45]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0MI8iw-1buCr43DnK-003uiN; Tue, 04 Oct 2016 18:40:20 +0200 To: Pascal KISSIAN , internals@lists.php.net References: <004101d21e33$124edf90$36ec9eb0$@lool.fr> Message-ID: <3c80d975-7622-ec7c-481e-32a7599ebd5d@gmx.de> Date: Tue, 4 Oct 2016 18:40:42 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <004101d21e33$124edf90$36ec9eb0$@lool.fr> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:IuQuiOJdPl1AJXgQCH8DOSx7W+xGcPN5dLTF4TFoG/LukyoNyIX IY1WZtS6IYQfiszA+MnIOQ5sUF8B5BmkemkHoVxrww9HxadVc8u3q9oLDfVpPBEE4FXwYPh sM3O7YpWDfg48f7Bs0QNor4f+uIbOyT/B61UsqZr7W6fE/JMbkr7LJd4Kqnhus0RCz/7aWs yrxU1C+s7ho7tqEKYygPQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:iZ2jOrfhM74=:G4jerMcV4Uv3yVTB0WNk8p zF5lcqwsYoXtptqQLs6k6cUUXvcJPqPAlqqyebXKWRZciknPw3YdN5uFEVubjjwF0QUHbLbb2 t0ZjexJLGk1Lq1oWgxKo10QUQPf7TvHcP0yKPD8DeAIML3lbkTWbFDViTmtie/b+0F9j2FSMG AEa+qJ2gYXXtRRCzcm9POLW2HmFJsib1iI82R2Y8de8s8EC8vpfQcJkmrB6XiIRHILchRzSPd wxqYcH7cV3iNdAN506y/DfJizWewqPguK3+FA0nGlNStk9X6uTcxPe73OstYDMQ7qu6ZBRZBu arfB9m99y7SB0ZQs5RViPYcPrsRutSw2RworKC1ffkEJfZMUL45phRO9h9clEmf0DedueWmX8 ZjOTdTy/jvqvsIYHCTAeZF123RcMio67dqzGa2W2PZ5vFh3KcGBkcr/Q8/sVpuhLE/HvPOGF2 XU/zvcEJfxOAINUtLYateG62MgDgAMt3g+Pww1pjOFovB3KXURKu2/3OCb1OBjtKsyqjPi39W 5dKaYaRSvHe2Iq3jRkRXHuEJPvhogHnccF8jITJnO3C5GlsoWiDNl3s7ehrEukWSEV3H2QYpY zpFm5eAEPlq1VjvZstsB6a1eoB3q7U708xY/IME1a+PyNJXXl0WXBDck1dyfje7EznNd50ygB GBpVzFG6Z4lBmoDlFzFzYJyryXQw1SoqTDB7dHbGUkCCe0AjWNjap8jnTu9G5DcZyZop1dR00 vppo8VPwijj2LjMwQsakUQnOAuUYKpTO877nAk1I94m+doe3sS1UG9ZHY3DMVtfixG60L4R7S Z384mrV Subject: Re: Feature Request: inline pseudo-instruction From: cmbecker69@gmx.de ("Christoph M. Becker") On 04.10.2016 at 13:33, Pascal KISSIAN wrote: > I have an application where a small file is included at multiple places. > > So far so good. > > The problem is that this include consists in a small piece of code which is > inside a multi-level loop. > > The include is done about an average of 100.000 times . > > When I manually replace the include with the code which is inside, the > performance boost is about a 50-100 factor.. > (with opcache enabled, it is far worst without opcache). > > The problem is that if I make a change within the code, I do have to not > forget to make changes a dozen of places... > > Could it be possible to add a directive such as : > > inline < filename > > > That includes the file inline within the compiled pseudo code (at compile > time) ... > > (it does not have a big importance for me that the target pseudo-code sets > the line number of all inlined instructions to the line number of the inline > directive) > > Am I the only people needing this feature ? If you really need this feature, I suggest that you're using a preprocessor to prepare the files before they're compiled by PHP. A rather simple PHP script using preg_replace() might already be sufficient. -- Christoph M. Becker