Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103489 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 9502 invoked from network); 24 Nov 2018 03:27:21 -0000 Received: from unknown (HELO tbjjbihbhebb.turbo-smtp.net) (199.187.174.11) by pb1.pair.com with SMTP; 24 Nov 2018 03:27:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=php.net; s=turbo-smtp; x=1543621806; h=DomainKey-Signature:Received: Received:MIME-Version:References:In-Reply-To:From:Date: Message-ID:Subject:To:Cc:Content-Type; bh=Lcct9y5pWfbLoCFVU/ixTI vrX4VfCe9vrO78tgeNAOQ=; b=Mam21InC86c+68N0NMKoM2ZrQNxayMWHIlJZv5 //hbCkQlK7vpsv2GKYu1FQzqjYvQwpk6XGbY5Wtb1DlTDPYe6DI3uFnEkS+eTwvj 8ZGDKH7+2lueIFCYAUPNyekeI2WSyGc0ZojN/r9nENJkjA1Ztmz2gBiI9+JdZN0N 5hpLg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=turbo-smtp; d=php.net; h=Received:Received:X-TurboSMTP-Tracking:X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version:References:In-Reply-To:From:Date:X-Gmail-Original-Message-Id:Message-ID:Subject:To:Cc:Content-Type; b=w1shubgyX/gKapATQ6oCUefYwSm33WZcklbBqwhlKdVL9/0XmglNMbDFPqqJfe tj7LYnFcGj0FzDnP/vuVq8ltEFoT9pYpTGeB8ORsCH0N65sgw6ziWtuwotfVhaWj ZuAg9Ffu/0LlPVXKMSVGiUDwoSb8uSOFDoGV10/r78E+M=; Received: (qmail 3788 invoked from network); 23 Nov 2018 23:50:05 -0000 Received: X-TurboSMTP-Tracking: 4703279668 X-Gm-Message-State: AA+aEWbCKpHkHdjzBqJKAH+Kqz1DqpHGHCet6VRvohJEoSkqUowM6oSi 09M7VaoNlwZczZCr7q0UngNxNxQS24dZSuGjlPE= X-Google-Smtp-Source: AFSGD/VJXqDy0gD8PO6b2Qlijm2Ka55Ptzgzg5ENy9bhXHPDtV+KPi41RCZMWzZ6NXI9Dk0xWY8Ua/E2MecIGhgQ9j4= X-Received: by 2002:a0c:98ca:: with SMTP id g10mr16830221qvd.13.1543017004983; Fri, 23 Nov 2018 15:50:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: Date: Sat, 24 Nov 2018 01:49:50 +0200 X-Gmail-Original-Message-Id: Message-ID: To: rowan.collins@gmail.com, Dmitry Stogov Cc: Internals Content-Type: multipart/alternative; boundary="00000000000076ead2057b5da4a2" Subject: Re: [PHP-DEV] [mini-RFC] Disable opcache per script using "declare(cache=0)" From: zeev@php.net (Zeev Suraski) --00000000000076ead2057b5da4a2 Content-Type: text/plain; charset="UTF-8" On Sat, Nov 24, 2018 at 1:18 AM Rowan Collins wrote: > On 23 November 2018 12:48:40 GMT+00:00, Dmitry Stogov > wrote: > >Especially, the main preload.php, usually should be marked, to disable > >its caching. > > Sorry, could you explain for those of us in the peanut gallery why this is > the case? I'm struggling to understand what it means to preload something > but not cache it, and suspect I'm missing something fundamental. > > I'm not sure if you're missing anything fundamental - it's just that the preload.php file Dmitry's referring to (the one that's responsible to loading all the other files) - is one file that's pretty much by definition, will be of no use at any later point in the lifetime of the server. It preloads other files (which of course, should very much persist in the opcache memory) - but once it's done, it's done. That's why it kind of makes sense not to cache it. That said, I'm not sure whether having this feature as a declare() makes sense - at least in the context of the new preload feature. The preload file is likely to be fairly small, wouldn't it consume negligible amounts of shared memory and just one slot in the files table? And like Pierre suggested, perhaps we can simply default to not caching the main preload file (i.e. the one referenced by php.ini). Outside the context of preloading, there's probably some value in having this new declare() option. There are situations where you simply don't want to cache certain files (what I usually bumped into was in case of auto-generated, short-TTL files). That's why a lifetime or two ago we added the blacklist feature - the declare() syntax would offer a new way to do that that is configurationless and built into the code. In that sense, it's not a bad thing. I'm just seeing it as not so much related to preloading, and more of a general-purpose feature. Unless of course I'm missing something..? Zeev --00000000000076ead2057b5da4a2--