Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:114849 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 75689 invoked from network); 14 Jun 2021 00:04:47 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 14 Jun 2021 00:04:47 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id D88D41804C0 for ; Sun, 13 Jun 2021 17:20:54 -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=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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-Virus: No X-Envelope-From: Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (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 ; Sun, 13 Jun 2021 17:20:54 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id bp38so18169183lfb.0 for ; Sun, 13 Jun 2021 17:20:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=craigfrancis.co.uk; s=default; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vpHQjkNqCbEGeihMVH0JsRm32JRXZ72yVeuCJDI8ZUc=; b=M4QXADnj4rTHekGAuhIrmmBdwK/94X91lfjpWSDqMDrAC2kI4ZXm4mvrVClExDrJsd gwmthJb/fIynVVFCx5gupXftFzpKuo+TI8DzhzM6Tl1dX8bUMkMtKR/u6fZIZjJ66Cjm J21SMutq4FMnnUjLKpRBbSPJ9hfZh5KXI81HI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vpHQjkNqCbEGeihMVH0JsRm32JRXZ72yVeuCJDI8ZUc=; b=ftoFewND/S4E02YGTmK6e23jkgmQp+TGYn9zQ1Ui5PB4nnldIMUN601xIhUuWKdlBK thW+NYcY2PGqSxZroeMW6s1Qv1e/LRYib7/5C9R0cma8tbZtNCTl2wID9ktm5KWx5nBJ bZkmtP5lqOmT6P6QqwiSEhI56D19FB7Y17N5VEv/0NGLOyu1HlUT1QnT+OCCqWOSO+MP JVxTYyShOW5v1Nk2Ai2WtMi6mCkE7qRRoa3UBPArxf+LxL9Cwv3YCxrJK0rZ+7dyBp/P cAAaQZ+IbWchG2jpyktBmvZF0eZUe8kL34uo9CkGOAQXWfXLZPR5etEOIX3dXGHLyiHf EtiA== X-Gm-Message-State: AOAM532LxDrQp/hNvH3CIxqJuvDjqJyeuR1AmWC5sSANTUeNG7tATjW7 UoX/VTgEt47J7yp9CPRe7ApZGTdwiahxo84WzuHI0g== X-Google-Smtp-Source: ABdhPJyiAANmzSXqCHpIQVPRl7yvWq6HvyqVRIcVOaGY+56ps3ghRTyJ/YgT5IpgJdCDMneBqQ0DfssZ6JaatYN1qI0= X-Received: by 2002:a05:6512:3a6:: with SMTP id v6mr2588232lfp.572.1623630052724; Sun, 13 Jun 2021 17:20:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Mon, 14 Jun 2021 01:20:41 +0100 Message-ID: To: Matthew Brown Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000008a246205c4aed420" Subject: Re: [PHP-DEV] [RFC] is_literal From: craig@craigfrancis.co.uk (Craig Francis) --0000000000008a246205c4aed420 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 13 Jun 2021 at 22:30, Matthew Brown wrote: > I was skeptical about the first draft of this RFC when I saw it last mont= h > [...] Sorry for any unnecessary grief I caused. > Hi Matthew, actually I'd like to thank you for that early feedback, the first draft did need work doing to it, and your feedback, along with others, helped me focus on the main concerns. > The only remaining issue I have is performance =E2=80=94 Psalm and other = static > analysis tools perform quite a lot of concatenation (and never have to > worry about user input). What sorts of slowdowns do you see when running > those tools? > For Psalm in particular, I=E2=80=99ve just done a quick run of 10 alternati= ng tests on a website with 90,000 lines of code, at error level 2 (the default level), using `--no-cache`, using PHP 8.1.0-dev from a couple of weeks ago. Without `is_literal` it averaged 8.355s, and with is_literal, 8.373s - so that=E2=80=99s a +0.018s difference, or +0.22% (full numbers below). It=E2=80=99s not full lab-condition testing, but hopefully more than repres= entative enough. (And repeating the RFC, just for a quick reference: M=C3=A1t=C3=A9, who doe= s stress-tests on servers, found that the Laravel Demo was +0.124%, and Symfony Demo was +0.161%. There was also a stress test, which simply concatenated 4 strings, 5 million times, with no other actions, so not exactly representative of a typical PHP script, which was +3.719%. None of these tests involved connecting to the database, as the variability introduced made it impossible to measure that level of difference). Full Psalm-check Stats: A =3D Without is_literal B =3D With is_literal A =3D Checks took 8.36 seconds and used 229.894MB of memory B =3D Checks took 8.46 seconds and used 229.894MB of memory A =3D Checks took 8.43 seconds and used 229.894MB of memory B =3D Checks took 8.57 seconds and used 229.894MB of memory A =3D Checks took 8.50 seconds and used 229.894MB of memory B =3D Checks took 8.40 seconds and used 229.894MB of memory A =3D Checks took 8.36 seconds and used 229.894MB of memory B =3D Checks took 8.32 seconds and used 229.894MB of memory A =3D Checks took 8.31 seconds and used 229.894MB of memory B =3D Checks took 8.38 seconds and used 229.894MB of memory A =3D Checks took 8.30 seconds and used 229.894MB of memory B =3D Checks took 8.29 seconds and used 229.894MB of memory A =3D Checks took 8.31 seconds and used 229.894MB of memory B =3D Checks took 8.37 seconds and used 229.894MB of memory A =3D Checks took 8.37 seconds and used 229.894MB of memory B =3D Checks took 8.32 seconds and used 229.894MB of memory A =3D Checks took 8.31 seconds and used 229.894MB of memory B =3D Checks took 8.29 seconds and used 229.894MB of memory A =3D Checks took 8.30 seconds and used 229.894MB of memory B =3D Checks took 8.33 seconds and used 229.894MB of memory --0000000000008a246205c4aed420--