- Issue created by @quietone
- First commit to issue fork.
- Merge request !5166Issue #3343913: Add comments explaining performance improvement in TypeData β (Open) created by _shy
- Status changed to Needs review
about 1 year ago 6:25pm 28 October 2023 - πΊπ¦Ukraine _shy Ukraine, Lutsk πΊπ¦
I would like to suggest a comment like this for this code part.
- Status changed to RTBC
about 1 year ago 4:11pm 30 October 2023 - πΊπΈUnited States smustgrave
Reading the original comment on [#14908519] mentions this was changed for performance. Believe the phrase "is the fastest." covers that point. So think this is good.
- πΊπ¦Ukraine _shy Ukraine, Lutsk πΊπ¦
Hi!
Are any additional changes needed here? - Status changed to Needs work
about 1 year ago 4:32pm 10 November 2023 - π¬π§United Kingdom catch
I was about to say no, nothing else to do, but I think there is:
1. The comment should link to where the performance optimization is documented, that seems to be https://blog.blackfire.io/php-7-performance-improvements-encapsed-string...
2. Are we sure that this is still a performance improvement in PHP 8? i.e. that the concatenation operator hasn't had similar improvements since?
- Status changed to Needs review
about 1 year ago 11:56am 11 November 2023 - πΊπ¦Ukraine _shy Ukraine, Lutsk πΊπ¦
Thanks @catch for your comments.
1. Added a link to the blog article in the description.
2. I'm not sure if any performance changes were made for the PHP 8 for the string concatenations. I couldn't find any mentions about that.
- Status changed to RTBC
about 1 year ago 6:17pm 11 November 2023 - πΊπΈUnited States smustgrave
Link has been added to comment per recommended.
I know we don't mention interpolation (will admit no idea what that is) but these were the best links I think I could find
https://gist.github.com/Atulin/406881ee184aede02475b832147f7c12
https://wpshout.com/php-concatenate-strings/#gref
Here weβre using the PHP concatenate operator, . again, rather than relying on PHP string interpolation. There is good-and-bad in both of these options. And all three work fine. The performance overhead of using string interpolation on double-quoted strings is small enough that I donβt think you should worry about it. But you will hear people point to the (true) fact that the third example in this section is (very marginally) faster
PHP STRING INTERPOLATION? USE SINGLE OR DOUBLE QUOTES? section
Not sure if that helps answer the question?
- Status changed to Needs review
about 1 year ago 8:09pm 14 November 2023 - πΊπΈUnited States xjm
The conclusions in π Evaluate replacing all usage of sprintf by dot concatenation or variable inside string Active contradict the comments here.
- Status changed to Postponed: needs info
about 1 year ago 3:08pm 20 November 2023 - πΊπΈUnited States smustgrave
From reading π Evaluate replacing all usage of sprintf by dot concatenation or variable inside string Active this still something we want to do?
- Status changed to Needs work
about 1 year ago 5:00pm 20 November 2023 - π¬π§United Kingdom catch
#12 is right, this should explicitly mention this is being done because the code can run in the critical path.
- Status changed to Needs review
about 1 year ago 7:56am 28 November 2023 - πΊπ¦Ukraine _shy Ukraine, Lutsk πΊπ¦
Directly added mentions that this code can run in the critical path.
- Status changed to RTBC
about 1 year ago 2:30pm 28 November 2023 - π¬π§United Kingdom longwave UK
Committed and pushed efecede14e to 11.x and d4f1ab7f8e to 10.2.x and 841980744f to 10.1.x. Thanks!
-
longwave β
committed 84198074 on 10.1.x
Issue #3343913 by _shY, smustgrave, catch, xjm, quietone: Add comments...
-
longwave β
committed 84198074 on 10.1.x
-
longwave β
committed d4f1ab7f on 10.2.x
Issue #3343913 by _shY, smustgrave, catch, xjm, quietone: Add comments...
-
longwave β
committed d4f1ab7f on 10.2.x
- Status changed to Fixed
about 1 year ago 10:51pm 28 November 2023 -
longwave β
committed efecede1 on 11.x
Issue #3343913 by _shY, smustgrave, catch, xjm, quietone: Add comments...
-
longwave β
committed efecede1 on 11.x
Automatically closed - issue fixed for 2 weeks with no activity.