Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:126146 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 0C3041A00BD for ; Fri, 20 Dec 2024 19:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1734722645; bh=EmEh0lhDZB7ycA9+cgsaQCmYdGDLmmg0Tc50dnBFRiU=; h=Date:From:To:Subject:From; b=gBFjpJ9DQ78NI+eBeLSyL3HVDiN7PzuHPpq5dZQwil0TqBJ4gozz1cUd/PDwKvlZW T05tkHcBX8KiwNg/gi7TG4QkTrrz3COwmgf6hVSVUxQ/SEGsg5tk0RkEsmLShEaGsS zcGitKfhQimL59XANf9F1Om9pkW64GJXgwlTo18MBNE3XsttRrwQXY+WDicmlNkXWl f3o2VMkhO8O6db3+E9uGrtNaMmJFk8tiy0Gl4JEzYeUT5nrKkQ0Pr0L7DsGFyzNkh6 rFZUHn8XM2Rlf7+qZ5u/r9RPr6sjxvm3Q4UyKsz/ByOSpa5l1B43eib105DRAQromp XFLlwkHFi0HJw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 895AD180072 for ; Fri, 20 Dec 2024 19:24:04 +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=-0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh-b4-smtp.messagingengine.com (fhigh-b4-smtp.messagingengine.com [202.12.124.155]) (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 19:24:03 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfhigh.stl.internal (Postfix) with ESMTP id E941825401AF for ; Fri, 20 Dec 2024 14:27:05 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-01.internal (MEProxy); Fri, 20 Dec 2024 14:27:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:message-id :mime-version:reply-to:subject:subject:to:to; s=fm1; t= 1734722825; x=1734809225; bh=2lxS27J3MCaTwzp/SCz36ppXLUgRoNxG8Ui Z971Y4Y8=; b=aBYWB19a7i+oGYxeRhJyimc82pzoTq+4mWk9G9het9oFC/iX57m D/i8/9AcntbrDT47DQTbQ1CGT/N4gEFhiffb/tJYIeHVThacK/8rEtUPfkLw9Nt9 5WaUnV4vFBNtAqWljsFRLwHLYjSBy1manKovxILrkNY3iyA+ww/X0j1mpWlrknVj J0/+MzcqXQYMAdDHnWs3iinrGO7VZxkqgjI1TC16kni/2RfrUo8xcxjrluMgsmD1 XyEWLULz9uV1G8FWaIq8ISIhLfJwKp5NNrN19//StpD3473SLmRC3j7uwiViGnf+ ykRSvBGRyjtWmTi2tzgSk5pB5YcjP/clzfA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1734722825; x=1734809225; bh=2lxS27J3MCaTwzp/SCz36ppXLUgRoNxG8Ui Z971Y4Y8=; b=XCOXZXr/rvmXdmKOPE6rIGYcMSR+7Kul7nRnKp3piSXmQl1yMTu DLwy48YsK0SnXi/7vKy/x7NXSAjew+v2NRtG/qm1+1C/nfkhMsgPr++wSqD0KTKV K93WwjiV+oQ2EzMHYIHrCVZ2awA3d9a8ENCUuYyBbfEnbIcA4wV1hXOMKRvosIkp YMRihlVC4y6TetByontYb1i9ULpmL5/z2wi6no02uW/zdLfYjJTow0xeWGnMmKy0 687RsPw9xonF9hoizjYdeQVNHMTri67gLOwks9kKTyJ9QYYbB32Vr3BkcuB3SJbK ItK+1pVy7QOaB8U5wlF8mCQ4/egHZ+aR8/A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddruddtvddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefoggffhffvkffutgfgsehtjeertdertddtnecu hfhrohhmpedfnfgrrhhrhicuifgrrhhfihgvlhgufdcuoehlrghrrhihsehgrghrfhhivg hlughtvggthhdrtghomheqnecuggftrfgrthhtvghrnhepffffkeelveettdehjeethfdt vdeuleejjefgfefgieduledtieekkeekiefgtdeinecuffhomhgrihhnpehtihguvgifrg ihshdrtghomhdpghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtoh hmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehi nhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 8224E29C006F; Fri, 20 Dec 2024 14:27:05 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Date: Fri, 20 Dec 2024 13:26:41 -0600 To: "php internals" Message-ID: <27531d9d-9bfe-4acc-b9ab-80b1017e3038@app.fastmail.com> Subject: [PHP-DEV] Discussion: Remove file statcache? Content-Type: text/plain Content-Transfer-Encoding: 7bit From: larry@garfieldtech.com ("Larry Garfield") 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 you try to do two file-infomation operations on the same file in rapid succession, without any other file reads in between. For more info: https://tideways.com/profiler/blog/the-php-stat-cache-explained Because it's so rarely relevant, in the cases it is relevant, it can be quite a surprise, and a surprise causing weird and hard to explain caching bugs in applications. The cache also dates from 20 years ago, when Rasmus added it (and the realpath cache) in Yahoo's forked PHP 4, and then it got integrated into PHP 5. However, hard drives are vastly faster than they were then, and operating systems are vastly more efficient than they were then. There's been some discussion about making the cache disable-able, though 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 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? What additional data would you need to make the case for such removal? -- Larry Garfield larry@garfieldtech.com