Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:116323 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 20862 invoked from network); 12 Nov 2021 09:25:11 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 12 Nov 2021 09:25:11 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CFAE4180544 for ; Fri, 12 Nov 2021 02:19:06 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_05,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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, 12 Nov 2021 02:19:03 -0800 (PST) Received: by mail-pf1-f172.google.com with SMTP id g19so8116025pfb.8 for ; Fri, 12 Nov 2021 02:19:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=4oh0ANG3GxJmWp/BUW2uRE1zBPbqlC+/4FSYFK0CKTU=; b=ARA60I30JK/5A7ciludyVw/TvjrG4CK730aFZ3jW/8Myp4K8OFYJHGU3smWx8j8Okf QP07yySTcphaclcVaPsm0JV8E77kzbjuKAIOwz1HkhgkWECgeHAeVme4HNTXaTiyDWp4 SC/rrxlSYBSyZUlBDlsitHffFl5IcTychiBjYliUapCj95x1NU4wNcKA74COkBsK9fc1 HKjAIStNz1gdvtdsX7rsL2zhd3rHSTMDgxXVXIPWCbLoT1YjkVkn/rpKxrigEDfxct7o YkiF6uha0tvlg2l7slWi5FH/lDqdiqtylqhgLUSL0O0h7nVr6ZmrZQYuv8KgQeMbtkYL IW2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=4oh0ANG3GxJmWp/BUW2uRE1zBPbqlC+/4FSYFK0CKTU=; b=Z899LRHc9vdB+zpDXkDFlyPUoHtQ20a+rL6LX4kWzk3tIGd63x3BDYgVTUPcs7V/OA dyLFD+LLPop0mZBPnu4Ul/HERlH9mQ7kduKTxt6HN0xBJjftco4ejuMei5gv14uy/tl8 muWeBlir/gICdfl+tFuR3warv+ue1bmC4D37iGShdoBLnPoe/rTjdHnsRipmiHb/UBkc FhskPCxItP3uPENUASED7IP1I8O9FCQZg/Vvhix3uyilqv1LMDsaBc3Ls+gJi787fli8 pmRDH/gjwhwMPrJO0deuX6NpPzMYS+Z38CrnZRYpiw2wT8JY2BZZ4r2y3GliWLrC3axT zUZw== X-Gm-Message-State: AOAM531yb7cRE25s3HIuKoyM/zdjlXE73QxD6xD6SUi0NqLtgneUjwqZ 7FMGavZW50IzXEIDVwe3ra4ysRqWmEGn1DoM7/iJ6zaL2w1StQ== X-Google-Smtp-Source: ABdhPJyNGgWw0ILTvtghrdV5OnHzPB0rEPtZKLFPk7BP/ltci+viNakmzXI9XsOFpmvjZ1f+FbtfXmxqlHXIvRYase8= X-Received: by 2002:a62:7b8e:0:b0:49f:a0ba:67ff with SMTP id w136-20020a627b8e000000b0049fa0ba67ffmr12939516pfc.64.1636712341657; Fri, 12 Nov 2021 02:19:01 -0800 (PST) MIME-Version: 1.0 Date: Fri, 12 Nov 2021 11:18:50 +0100 Message-ID: To: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000b95d3605d094c9b0" Subject: Automatic performance benchmarking: PHP 8.1 is ~30% faster than PHP 7.4 From: kocsismate90@gmail.com (=?UTF-8?B?TcOhdMOpIEtvY3Npcw==?=) --000000000000b95d3605d094c9b0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello Internals, I'm writing this email because lately, I've been working on an automatic benchmarking framework for PHP, and I'd like to share some news regarding it. The initial implementation was sponsored by Craig Francis, and it was used for the evaluation of the performance aspects of the is_literal() RFC. Since then, I fixed numerous issues and implemented many new features, so with the very close advent of PHP 8.1, the time has come to unveil it. I'm sure that many of you still remember Intel's automatic benchmarks from a couple of years ago (e.g. https://externals.io/message/89843#89843). I loved these emails, so this project served as a great inspiration for me to start working on something similar. I have to admit though that I won't be able to replicate their extremely advanced setup. My main goal was to develop a framework ( https://github.com/kocsismate/php-version-benchmarks) which is: - fully automatic so that it can be easily run regularly, and the benchmarks are reproducible - it's possible to try it out locally via Docker, but it can be run in the cloud (currently, only AWS is supported), and the instance type is configurable - supports different CPU platforms (X86-64 and ARM64), and advanced options whether turbo boost/hyper threading/deeper CPU C-states are enabled is configurable - supports any version of PHP since PHP 7.4, including any git branches or commits - supports the most important PHP configurations, including whether OPcache/JIT/preloading is enabled - supports multiple tests: currently, the micro benchmarks bundled with php-src, as well as the Symfony and the Laravel demo sites as "real-life" tests are included with some customizability (number of warmups, iterations number, number of requests) - results are measured via using PHP-CGI which is a lightweight web server with very a small overhead The most current benchmark is available at https://github.com/kocsismate/php-version-benchmarks/blob/main/docs/results= /2021_11_11_09_20_1_aws_arm64_c6g_4xlarge/result.md . I'm happy to share that the results suggest PHP 8.1.0 is around 28-32% faster than PHP 7.4 in real-life tests, and a few percent faster when it comes to micro benchmarks. The benchmark was performed on an ARM64 instance because this platform provided much more stable results than X86-64-based ones did, mainly due to their fixed CPU frequency. Unfortunately, the benchmark is not yet suitable for detecting minor performance changes between commits as the run-to-run variation of the results is a bit too high; in some cases, it can be up to 1-2%. I hope that this problem can be mitigated to an acceptable level in the future, but most probably I'll need some help to achieve this. So any help is appreciated! Furthermore, I'd have some questions regarding this project: - Would you welcome automatic emails on internals (or on a dedicated mailing list), just like how Intel did it? I'm not sure about the frequency, but in my opinion, 1-2/month would be a sensible one, given there is interest in it. - Does anyone know how to get some sponsorship from AWS (or from some other cloud provider at last resort)? I already tried to apply for AWS Activate's free credits, but my application was rejected due to different reasons (normally, this program is available for startups). I have some hope that running the benchmark on a dedicated instance would decrease variation of the results, but enabling this feature is relatively expensive compared to other costs, so I'd be very happy if I wouldn't have to sponsor all of this, when I already dedicate a great deal of my time to the cause. - As always, I'm happy to receive feedback and improvements (ideally along with an implementation :) ). For example, currently I've started working on some visualization and chart support, but frontend stuff is not my area of expertise, so I'm progressing a bit slower than normally. Also, the statistical foundations could be reviewed, and possibly improved. Regards: M=C3=A1t=C3=A9 --000000000000b95d3605d094c9b0--