Re: Discussion: Remove file statcache?

From: Date: Sun, 22 Dec 2024 04:05:20 +0000
Subject: Re: Discussion: Remove file statcache?
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Sat, Dec 21, 2024, at 2:18 PM, Juris Evertovskis wrote:
> While it is nice the Symfony and WordPress wouldn't suffer a lot from
> dropping this cache, what's the impact on scripts that are processing
> hundreds of files?
>
> Would doing  $stat = stat($filename); instead of separate calls to
> filemtime and filesize actually be important? Or would it still
> amount
> to 1% performance difference on an SSD?

The limited data so far suggests it isn't that important, unless you're doing filemtime(),
filesize() together in order over hundreds or thousands of files.  In that case, calling stat()
would be better, though by how much is unclear.  Or using SplFileInfo().  (I have no idea if it uses
the stat cache or loads the stat data once and just exposes it through methods.)

> I mean, are there cases when this cache is still useful in 2025?

That is indeed the question. :-)  I think so far we can say "not most of the time," but
haven't yet figured out all the possible edge cases.

--Larry Garfield


Thread (25 messages)

« previous php.internals (#126161) next »