Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126149 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 9C7C91A00BD for ; Fri, 20 Dec 2024 21:53:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1734731398; bh=0OmVwUhnq493I4f2la7qgLsycmA3y7jCVotticiTuMI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=a/2gP7bSQFwx7GhCsI9KWYg+LAbrxiMnqxQZ7hom27lGYjTxPkE8+/XPJIIYa1hMt pLFzU2mOQaNP5JYT0hEn1qTAYqiumekvj82ZjXXhck9IBfuwQ6LlDytQLn2xB+JcRN hwDRXLP2feQ3X+N2JH24oA7lnZetXmTNoChQ9BmpE6mcLlu4allDjmNatAmpXHi846 Wy8yruMmA6PimbZuoeBk0A0CL3q7SVp4lTWYkKui5Zb7i+V5RI/P8CGVUWwogpmtqP 5Kt3dGhKMD83SsrEPk2pZLIwIr5gzVQvC3ljkf6wu3t05f7shbpIEt9vBnJ95NMVIb Gq75evNgi2d3A== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 1B201180071 for ; Fri, 20 Dec 2024 21:49:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=2.0 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-oo1-f45.google.com (mail-oo1-f45.google.com [209.85.161.45]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 20 Dec 2024 21:49:56 +0000 (UTC) Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-5f2e13cb356so997979eaf.2 for ; Fri, 20 Dec 2024 13:52:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734731578; x=1735336378; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FHjW3FoXzRHsESrGdHBlEvroScnnDm4q2Xr3ba6nShc=; b=KCcONqQjGKiKEkvDQ2pyj7wCfe6UjeYTCqwTTZjVLvzXaRpi1zIZo9Dx5v/WneaG08 zi/HXyOfx1UgzZROXzm4tG88hq6LeW2htPzqpsE4Zcvv9tjsPfXfs4XF8Cy3gwdTSqCl uXeDvLxpO0f1tkaz4Wv7uE/ewFyMUU8eg/XNgFpWFPGMfE9tvJV+2+YgPQS3nueUOHS0 Y4Ne5amAiQ1DK7oXugy+Ayl49eSHhnq2c2RXKVmu/ipfcH1NJJIdG82MyCV6ZIDECPfR P01JCIV2eYOn/iEOktHKuKk6lEcksFQ8Kpn91lCb81EA/fZKsDMMQP9aw59oJtXhXZkv Egbw== X-Forwarded-Encrypted: i=1; AJvYcCXTDZCn4pXtxraHsJ1fwIL/38DYi4z9R0kDtyl+29xPHuxFow69afNRRRsR5n0sLhezW4qXyu7KU14=@lists.php.net X-Gm-Message-State: AOJu0Yz0La4MaSrU6nu3t7It0Hkc8b84LYZ3Y5H2Wgkik3gtyOdwLxzf dCJmNHpWJ7eie2jJ7+7BOVIaJuPGE5ZEl/DkE0kYlBuAAiWa8l7gxRa8SXfeUuGfiKi6JR0Kc8o LKOlMwhbMJj2+LCOLkRjQFCM9T70= X-Gm-Gg: ASbGncvnaUGvISVyCiU1tXbzmeblLzMk0UbK+1kX4lHM8zMyHHWk3HyoCRytcZ1SkRr J8ZYpdm1+ZePjhh+1h/Sdk2UHTJH8kBhjAVce X-Google-Smtp-Source: AGHT+IGv54wOCaVA2m5Zbq7RFdJlTn19pC83K9ARLkPt2gqiYCb54gWFPJ85+a+pTlboaJJb8yVqym2/oPxOrwF+3fY= X-Received: by 2002:a05:6871:630e:b0:296:e698:3227 with SMTP id 586e51a60fabf-2a7fb3e1e99mr2607651fac.36.1734731577843; Fri, 20 Dec 2024 13:52:57 -0800 (PST) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <27531d9d-9bfe-4acc-b9ab-80b1017e3038@app.fastmail.com> <32bb41ba-11c0-4b20-92d9-7dce513c97a5@gmx.de> In-Reply-To: <32bb41ba-11c0-4b20-92d9-7dce513c97a5@gmx.de> Date: Fri, 20 Dec 2024 22:52:46 +0100 Message-ID: Subject: Re: [PHP-DEV] Discussion: Remove file statcache? To: "Christoph M. Becker" Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="0000000000007a646e0629baab3b" From: bukka@php.net (Jakub Zelenka) --0000000000007a646e0629baab3b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Fri, Dec 20, 2024 at 10:37=E2=80=AFPM Christoph M. Becker wrote: > On 20.12.2024 at 20:26, Larry Garfield wrote: > > > Background: PHP has a not-often-considered feature, the stat-cache. > That is, the runtime caches the OS stat() call for files, so that > subsequent reads on the same file can be faster. However, it's even less > realized that it's a single-file cache. It literally only applies when y= ou > try to do two file-infomation operations on the same file in rapid > succession, without any other file reads in between. > > > > There's been some discussion about making the cache disable-able, thoug= h > the consensus now seems to be leaning toward getting rid of it outright: > > > > https://github.com/php/php-src/pull/17178 > > > > Arnaud ran some quick benchmarks and found that disabling it has a less > than 1% impact on Symfony and WordPress. > > > > https://github.com/php/php-src/pull/17178#issuecomment-2554323572 > > > > Before we go any further, is there appetite among the voting population > to remove it? clearstatcache() and similar functions would get stubbed o= ut > as no-ops, but otherwise we'd just hand the responsibility back to the OS > where it belongs, which seems so far like it would be almost an > unmeasurable performance difference but remove some surprise complexity. > > > > Would you support such a removal? > > I still think the stat cache should be *deprecated* first. That gives > users a chance to reconsider calling multiple stat related functions > instead of doing a single stat() call. See my previous comment[1] for > some further details. > > I don't think we should force users update their code because of negligible perf impact. Most of the time this want play any role in perf anyway as often for applications, that actually do something, the most time is spent on waiting for IO. So I really don't see a reason for deprecation in this case. Regards Jakub --0000000000007a646e0629baab3b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Fri, Dec 20, 2024 at 10:3= 7=E2=80=AFPM Christoph M. Becker <c= mbecker69@gmx.de> wrote:
On 20.12.2024 at 20:26, Larry Garfield wrote:

> Background: PHP has a not-often-considered feature, the stat-cache.=C2= =A0 That is, the runtime caches the OS stat() call for files, so that subse= quent reads on the same file can be faster.=C2=A0 However, it's even le= ss realized that it's a single-file cache.=C2=A0 It literally only appl= ies when you try to do two file-infomation operations on the same file in r= apid succession, without any other file reads in between.
>
> There's been some discussion about making the cache disable-able, = though the consensus now seems to be leaning toward getting rid of it outri= ght:
>
> https://github.com/php/php-src/pull/17178
>
> Arnaud ran some quick benchmarks and found that disabling it has a les= s than 1% impact on Symfony and WordPress.
>
> https://github.com/php/php-src= /pull/17178#issuecomment-2554323572
>
> Before we go any further, is there appetite among the voting populatio= n to remove it?=C2=A0 clearstatcache() and similar functions would get stub= bed out as no-ops, but otherwise we'd just hand the responsibility back= to the OS where it belongs, which seems so far like it would be almost an = unmeasurable performance difference but remove some surprise complexity. >
> Would you support such a removal?

I still think the stat cache should be *deprecated* first.=C2=A0 That gives=
users a chance to reconsider calling multiple stat related functions
instead of doing a single stat() call.=C2=A0 See my previous comment[1] for=
some further details.


I don't t= hink we should force users update their code because of negligible perf imp= act. Most of the time this want play any role in perf anyway as often for a= pplications, that actually do something, the most time is spent on waiting = for IO. So I really don't see a reason for deprecation in this case.

Regards

Jakub
--0000000000007a646e0629baab3b--