Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74318 invoked from network); 25 Jul 2016 07:55:31 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 25 Jul 2016 07:55:31 -0000 Authentication-Results: pb1.pair.com header.from=phofstetter@sensational.ch; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=phofstetter@sensational.ch; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain sensational.ch designates 195.226.6.199 as permitted sender) X-PHP-List-Original-Sender: phofstetter@sensational.ch X-Host-Fingerprint: 195.226.6.199 mail.sensational.ch Received: from [195.226.6.199] ([195.226.6.199:59136] helo=mail.sensational.ch) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BA/A1-61920-2F5C5975 for ; Mon, 25 Jul 2016 03:55:31 -0400 Received: from mail-lf0-f70.google.com ([209.85.215.70]:35300) by mail.sensational.ch with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76 and XAMS 0.0.20) id 1bRajY-0001RH-7z for internals@lists.php.net; Mon, 25 Jul 2016 09:55:28 +0200 Received: by mail-lf0-f70.google.com with SMTP id r97so110353329lfi.2 for ; Mon, 25 Jul 2016 00:55:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=rvSP4ezgSlTb0SpQU7Ob4wB9RfE0bghLeTldN5vyvI4=; b=NneSthKfS2KHuXzGRE4ODP1SBWD8/xkmba6o7jrepwKVTT+12+6Rbr9vio6SICAZ71 rFu3O7USZOJ5+rSuV6D2McRog1rYNq++GoE9wSJzlf7rWg8v0OVDtSVqLk82Kw/Yq19D sfZdb6h4smZ1B7q0UPG0LMQPRyVJP9p9l8TP33J54zq6ZZj9JZwZNHwLrkYZTxiPygLN Nj6/sLFuKZmnYQEw+5hGbuiMM+T3r2Rj7fAbN1RLvE7IoT2upbHnyGLPetMc/wvKGu6E FT2ftcjKhz+67AOBbPk+J2a5LgPyVL1PSiDxqOAOipWCwlFbS7DIO1d1GTt2BiWsq79J aZww== X-Gm-Message-State: ALyK8tIGNZ0E3mMfeQrViMNdCmrp6QlZYZUUunjd/iIVPwxMu07eC7Ry8EbutWeSswPvrr0gnebgu5Th/7M8G6znlvX8XRfvYtZXgGZ4ecqMkIzbFCd1wMnSTp/O0tk+UE3xB/zhsn1eLJX9BG3W+nYx00ebbmn9SjQrZsY= X-Received: by 10.28.232.145 with SMTP id f17mr37672065wmi.15.1469433327472; Mon, 25 Jul 2016 00:55:27 -0700 (PDT) X-Received: by 10.28.232.145 with SMTP id f17mr37672056wmi.15.1469433327292; Mon, 25 Jul 2016 00:55:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.134.202 with HTTP; Mon, 25 Jul 2016 00:55:07 -0700 (PDT) Date: Mon, 25 Jul 2016 09:55:07 +0200 Message-ID: To: PHP internals Content-Type: text/plain; charset=UTF-8 X-SA-Do-Not-Run: Yes X-SA-Exim-Connect-IP: 209.85.215.70 X-SA-Exim-Mail-From: phofstetter@sensational.ch X-SA-Exim-Scanned: No (on mail.sensational.ch); SAEximRunCond expanded to false Subject: stat cache / still needed these days? From: phofstetter@sensational.ch (Philip Hofstetter) Hi, I have just reported #72666 (touch() works differently on plain paths and file:// paths with regards to cleaning the stat cache) and I would gladly provide a PR with a fix and unit tests. However, before I start working on this (well - it would be an easy fix), I would like to question whether the stat cache is a good idea and whether it's still (or ever was) needed these days. File systems right now are really good at quickly providing the information: On MacOS I measure only 10% loss in performance when doing nothing but calling stat() and clearstatcache() compared to just calling stat(). Over NFS on Linux, it's 20%. Additionally, I wonder what the stat cache is actually helpful for - as far as I understand it, this only helps if you repeatedly call stat() (or a related function) on the same file within the same request which probably isn't very common application behaviour to begin with. As such, before I fix touch() to call php_clear_stat_cache(), maybe it's worth reconsidering the whole thing and removing it from PHP itself at least for later versions, though I guess there I would be in firm RFC territory which I'd be willing to write if I had RFC writing credentials. What do you think? Philip