On Sun, 13 Jun 2021 at 22:30, Matthew Brown <matthewmatt...@gmail.com> wrote:
> I was skeptical about the first draft of this RFC when I saw it last month > [...] 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 — 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’ve just done a quick run of 10 alternating 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’s a +0.018s difference, or +0.22% (full numbers below). It’s not full lab-condition testing, but hopefully more than representative enough. (And repeating the RFC, just for a quick reference: Máté, who does 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 = Without is_literal B = With is_literal A = Checks took 8.36 seconds and used 229.894MB of memory B = Checks took 8.46 seconds and used 229.894MB of memory A = Checks took 8.43 seconds and used 229.894MB of memory B = Checks took 8.57 seconds and used 229.894MB of memory A = Checks took 8.50 seconds and used 229.894MB of memory B = Checks took 8.40 seconds and used 229.894MB of memory A = Checks took 8.36 seconds and used 229.894MB of memory B = Checks took 8.32 seconds and used 229.894MB of memory A = Checks took 8.31 seconds and used 229.894MB of memory B = Checks took 8.38 seconds and used 229.894MB of memory A = Checks took 8.30 seconds and used 229.894MB of memory B = Checks took 8.29 seconds and used 229.894MB of memory A = Checks took 8.31 seconds and used 229.894MB of memory B = Checks took 8.37 seconds and used 229.894MB of memory A = Checks took 8.37 seconds and used 229.894MB of memory B = Checks took 8.32 seconds and used 229.894MB of memory A = Checks took 8.31 seconds and used 229.894MB of memory B = Checks took 8.29 seconds and used 229.894MB of memory A = Checks took 8.30 seconds and used 229.894MB of memory B = Checks took 8.33 seconds and used 229.894MB of memory