Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Christian Schneider
Am 02.09.2021 um 13:15 schrieb Kevin Lyda : > Removing it completely would be ideal, however a number of people objected > in the linked bug. And while it's not needed in modern Unix operating > systems, it's not clear if Windows might benefit from this. If I remember correctly it was about

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Nikita Popov
On Thu, Sep 2, 2021 at 10:27 AM Kevin Lyda wrote: > PHP has a stat cache which is... unfortunate. As noted in this bug from > 2004[0] it causes a number of issues for PHP users and is irrelevant > in modern operating systems. Heck, it's not even useful in OS's people > might consider ancient at

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Kevin Lyda
On Fri, Sep 3, 2021 at 2:34 PM Christian Schneider wrote: > If I remember correctly it was about reducing the number of system calls. Is > this no issue any more? > Has a quick benchmark been done to see the positive / negative impact of the > stat cache for a typical application? In the

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Go Kudo
Thank you. > Why is the number generator a parent class rather than an interface? This is an implementation limitation. I could not find a way to define my own object handler in interface. As Nikita pointed out in a previous suggestion, the NumberGenerator now uses php_random_ng_algo_user to

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Larry Garfield
On Fri, Sep 3, 2021, at 8:55 AM, Go Kudo wrote: > Thank you. > > > Why is the number generator a parent class rather than an interface? > > This is an implementation limitation. I could not find a way to define my > own object handler in interface. > As Nikita pointed out in a previous

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Go Kudo
My apologies. I had skipped one. > And either way it needs more clarity about how you'd write one for reals. Added a simple example comparing it to mt_rand. What do you think of this? 2021年9月3日(金) 3:26 Larry Garfield : > On Thu, Sep 2, 2021, at 10:10 AM, Go Kudo wrote: > > Hi Internals. > > >

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Christoph M. Becker
On 03.09.2021 at 16:07, Kevin Lyda wrote: > On Fri, Sep 3, 2021 at 2:34 PM Christian Schneider > wrote: > >> If I remember correctly it was about reducing the number of system calls. Is >> this no issue any more? >> Has a quick benchmark been done to see the positive / negative impact of the

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Christian Schneider
Am 03.09.2021 um 16:07 schrieb Kevin Lyda : > On Fri, Sep 3, 2021 at 2:34 PM Christian Schneider > wrote: >> If I remember correctly it was about reducing the number of system calls. Is >> this no issue any more? >> Has a quick benchmark been done to see the positive / negative impact of the >>

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Go Kudo
> I'm still unclear how I'd write my own NumberGenerator right now. I mean, I can extend the class, but I don't have a sense for what I'd do with it for non-testing/trivial implementations. You say it's using an internal function to generate numbers, but in user space what would I do with that?

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Nikita Popov
On Fri, Sep 3, 2021 at 4:08 PM Kevin Lyda wrote: > On Fri, Sep 3, 2021 at 2:34 PM Christian Schneider > wrote: > > If I remember correctly it was about reducing the number of system > calls. Is this no issue any more? > > Has a quick benchmark been done to see the positive / negative impact of

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Christian Schneider
Am 03.09.2021 um 17:23 schrieb Nikita Popov : > Just to throw it out there: Maybe we should clear the stat cache when > functions in the exec family are used? Even if we allow disabling the stat > cache, I think we can easily avoid that particular footgun. And if calls to > external binaries

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Go Kudo
Thanks nikita. > ext/standard to ext/random. Why does it do this? There are several reasons for this. - The `random` extension name is already used by ext/standard and may interfere with the build system. - Due to the namespace rules for new extensions, it is inappropriate to rename an

Re: [PHP-DEV] [RFC] Random Extension 3.0

2021-09-03 Thread Nikita Popov
On Thu, Sep 2, 2021 at 5:10 PM Go Kudo wrote: > Hi Internals. > > Expanded from the previous RFC and changed it to an RFC that organizes the > whole PHP random number generator. Also, the target version has been > changed to 8.2. > > https://wiki.php.net/rfc/rng_extension >

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Kevin Lyda
On Fri, Sep 3, 2021 at 4:24 PM Nikita Popov wrote: > Just to throw it out there: Maybe we should clear the stat cache when > functions in the exec family are used? Even if we allow disabling the stat > cache, I think we can easily avoid that particular footgun. And if calls to > external

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Christian Schneider
Am 03.09.2021 um 18:12 schrieb Kevin Lyda mailto:ke...@lyda.ie>>: > To run this php script: > > $iterations = 100; > function all_the_stats($filename) { > @lstat($filename); > @stat($filename); > } > while ($iterations--) { > all_the_stats(__FILE__); > } > > I see this output: > >

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Kevin Lyda
On Fri, Sep 3, 2021 at 9:12 PM Christian Schneider wrote: > I'm interested in the load put on a system with a high request count and a > typical application. > Reducing system calls used to matter there as the kernel does not > multi-process the same way user land does. > > But then again,

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Kevin Lyda
[sent a second time, now to the list, sorry] On Fri, Sep 3, 2021 at 3:53 PM Christian Schneider wrote: > How can you say "it never was a problem" if we never had to live without stat > cache? > Can you back up that claim with numbers? There are some of us who run > high-volume websites where

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Hans Henrik Bergan
PS i've seen *HORRIBLE* fs performance for php-running-on-windows, where the same filesystem operations on the same files took like 5 seconds on linux-running-on-vmware-on-laptop-running-windows-10, versus several minutes for the same operation on the same laptop on windows 10 directly.. for

Re: [PHP-DEV] Adding a way to disable the stat cache

2021-09-03 Thread Pierre Joye
Good morning, On Sat, Sep 4, 2021 at 4:51 AM Hans Henrik Bergan wrote: > > PS i've seen *HORRIBLE* fs performance for php-running-on-windows, > where the same filesystem operations on the same files took like 5 seconds > on linux-running-on-vmware-on-laptop-running-windows-10, versus several >