Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 84487 invoked from network); 4 Aug 2015 17:40:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Aug 2015 17:40:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.15.15 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.15.15 mout.gmx.net Received: from [212.227.15.15] ([212.227.15.15:58125] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 51/61-11835-809F0C55 for ; Tue, 04 Aug 2015 13:40:25 -0400 Received: from [192.168.0.100] ([95.89.139.132]) by mail.gmx.com (mrgmx001) with ESMTPSA (Nemesis) id 0MXI5V-1ZJXQe23Yz-00WE9b; Tue, 04 Aug 2015 19:40:21 +0200 Message-ID: <55C0F908.2050708@gmx.de> Date: Tue, 04 Aug 2015 19:40:24 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Anatol Belski , 'Christoph Becker' , 'Pierre Joye' CC: 'PHP internals' References: <55B0CADD.8000807@gmx.de> <55B136BE.8010006@gmx.de> <046401d0c644$9cf76880$d6e63980$@belski.net> <55B2B78A.4080202@gmx.de> <048001d0c665$ed19ec40$c74dc4c0$@belski.net> <55B2D779.9090409@gmx.de> <04d301d0c6e5$6b28f0c0$417ad240$@belski.net> <55B3B2E6.7080905@gmx.de> <056e01d0c7d9$b1edd990$15c98cb0$@belski.net> <55B559C7.9060304@gmx.de> <064301d0c85f$5260ac60$f7220520$@belski.net> <55C008B1.2050008@gmx.de> <05ec01d0ce97$4ee7c4e0$ecb74ea0$@belski.net> <55C09EE2.7010400@gmx.de> <063f01d0cec2$91b9baf0$b52d30d0$@belski.net> In-Reply-To: <063f01d0cec2$91b9baf0$b52d30d0$@belski.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:tfPjoMJN8Kl/JtJRig+QMgERDGy7j5q3ltTouqbFoDHemEsolNo ekwzR+SwHyv8D2e3sAn2LfwbwjOoER7XaKxDP/TRceyRq+D14Q2neue1AU/M5cpvHRJYUic 5vOmsKyJuwxI7C3XPmbdwA5hA6qGIdBcggzzRD6zrsbYA7waxOduBmkGeZaN/Omy6LcM33Y Z9EggrsmfHy5uey6WkWyg== X-UI-Out-Filterresults: notjunk:1;V01:K0:PBIlT9gzEjE=:hvT1MXLup2Qxp5pBsVNXHP c56oscnkMBbDAyM8VhkmovL8Xs7YFw7RU1Qhz8ZqTFis2J4Pg7GJasv19i7RQKWLpu00uTMLN pcJoRz8WgH33PVSN4lpX6eZO6m+t5JEfXv0/gtNzDFeoNsYM39fF8ItVnJgGGbSrqZGw6epbZ 7d6M2g9DEfswult7AKViSNTPFpfx8vx0r/7xqcWBwds70m2domKf36e25Lj/EvfAf9aaaBVWE P36HXzBLq0rAOn9CSfHzLp15kV3Mb7y4ayN7RJmgg4Ng49ifz55t60h41wFxJtaEMClYRk3G6 PXAbah2R0Q1NFnm8Dcq2NQcFMNH1I6MgtBNTeGYAPiqqsLCAp0IjALTG9vRSmY2PnPdwtJhJP PqOXm/0k3olK1Lr0IVUKVq6efRb/erCRPg9cUL5HA56c6Ailfkcm6Jjv5M2ZzT4rkBhoIcOM1 qyZusgW0nD/sv/8zxMItor3xmUnPUl2pmsfW40iTOmAgsuAMIaLMvqb43U0zXGZqoMQJtUlgm XqKIWVf5CDi5qbJVgfcDW5Gx8zHZEw70Yey6FZI8rHkJd5CW1ockwvO+60IQb87nejFyMfN4T qx3ymQkkokCEyBF7bj9PuBMWzhQ5OtlTEl6OGyfSM6XevT7e2HexIMsglASfPrNzyuZrM18BX lYOhvYYbFsOgfM8CNTDDa3DgmIMP/3Both/wgrgE6+rq6/L4QcuqQDde90ROsgk7fpqE= Subject: Re: [PHP-DEV] PCRE JIT stack size limit From: cmbecker69@gmx.de (Christoph Becker) On 04.08.2015 at 16:33, Anatol Belski wrote: >> -----Original Message----- >> From: Christoph Becker [mailto:cmbecker69@gmx.de] >> Sent: Tuesday, August 4, 2015 1:16 PM >> To: Anatol Belski ; 'Christoph Becker' >> ; 'Pierre Joye' >> Cc: 'PHP internals' >> Subject: Re: [PHP-DEV] PCRE JIT stack size limit >> >> I didn't mean to store all patterns in both variants, but rather as requested. Say, >> the PHP script starts with pcre.jit=0, so all patterns will be stored studied without >> JIT. Then the script changes to pcre.jit=1. Following cache lookups check >> whether an already cached pattern was studied with JIT. If not, a new cache >> entry is made with the pattern studied with JIT (that new entry may replace the >> old one or not; not sure what's best). Changing back to pcre.jit=0 will again >> keep the old patterns, but ensures that only those which have been studied >> without JIT are retrieved from the cache. >> > It needs to replace the old entry, the regex string is used as key. At least per current mechanism. When user changes the JIT config, I'd see it like as an obvious hint. Like pcre.jit=0 - no more JIT study from now on. Probably you're right that replacement is best. However, the key is the full regex string (including modifiers), AFAIK, and Adam already came up with the idea that choosing between JIT and non-JIT might be done via a new modifier[1]. Something to consider, if it turns out that there is some real optimization potential for userland to choose between both variants on a case-by-case basis. > Probably it would be needed to save the study flags with the cache entry, looks like the pcre_cache_entry struct should have a gap for that. If I'm not mistaken, an additional flag wouldn't be necessary, because the pcre_extra struct has the executable_jit field, which could be queried. [1] -- Christoph M. Becker