Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:115940 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 56512 invoked from network); 3 Sep 2021 19:35:44 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 3 Sep 2021 19:35:44 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E37FE1804C9 for ; Fri, 3 Sep 2021 13:12:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, SPF_HELO_NONE,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS1836 195.49.0.0/17 X-Spam-Virus: No X-Envelope-From: Received: from darkcity.gna.ch (darkcity.gna.ch [195.49.47.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Fri, 3 Sep 2021 13:12:16 -0700 (PDT) Received: from smtpclient.apple (unknown [IPv6:2a02:1205:502d:fa80:5cf1:8b5b:a823:3c77]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by darkcity.gna.ch (Postfix) with ESMTPSA id 28F99151668F for ; Fri, 3 Sep 2021 22:12:13 +0200 (CEST) Content-Type: multipart/alternative; boundary="Apple-Mail=_F16A97AC-C00C-4BEB-8754-A4706F102AF9" Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Date: Fri, 3 Sep 2021 22:12:13 +0200 References: <0A048A30-444F-4DB0-A79C-9EA9BD07B1EC@cschneid.com> <569E3A48-E3F5-46FA-BA08-D2493CE4FD33@cschneid.com> To: PHP internals In-Reply-To: Message-ID: <9B6A493C-DBA6-4CF0-9AE2-DAA0A700A7D2@cschneid.com> X-Mailer: Apple Mail (2.3654.120.0.1.13) Subject: Re: [PHP-DEV] Adding a way to disable the stat cache From: cschneid@cschneid.com (Christian Schneider) --Apple-Mail=_F16A97AC-C00C-4BEB-8754-A4706F102AF9 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Am 03.09.2021 um 18:12 schrieb Kevin Lyda >: > To run this php script: >=20 > $iterations =3D 1000000; > function all_the_stats($filename) { > @lstat($filename); > @stat($filename); > } > while ($iterations--) { > all_the_stats(__FILE__); > } >=20 > I see this output: >=20 > Without cache >=20 > real 0m7.326s > user 0m5.877s > sys 0m1.448s > With cache >=20 > real 0m5.010s > user 0m5.009s > sys 0m0.000s So this is almost a 50% performance regression ;-) And the more interesting number for me here is "sys 0m1.448s" vs "sys = 0m0.000s". Which means 1.5s out of the additional 2.3s are spent in = system calls. Side-note: Why is the user time without cache higher than with cache? = That seems counter-intuitive. Maybe the checking of the ini-settings or = some libc-code? 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, maybe I'm overly cautious :-) Regards, - Chris= --Apple-Mail=_F16A97AC-C00C-4BEB-8754-A4706F102AF9--