Hi internals,
I'm looking for someone to test the performance impact of a change to PHP.
Specifically the change affects how PHP does string concatenation, in
regards to the is_literal() RFC[1], where Joe Watkins has created an
initial patch[2].
This might not be the final version, I just want to have some rough stats
on the impact it would have, if you have any suggestions on how to improve
it, and an opinion on whether this would be a problem in getting approval
from internals (I'd like to quote you in the RFC).
It would be paid work, as I can't expect your help for free. I'm hoping to
keep within a budget of £2,000 for this bit, and happy to do a PayPal or
Bank Transfer based on the number of hours or days worked (your preference).
I have emailed Dmitry off-list, on Sunday, assuming I've got the email
address correct.
And I've done some basic tests myself; where the main one doesn't represent
a typical PHP project - which is a loop concatenating the same string 5
million times[3] using a similar approach to micro_bench.php[4]... I think
that's the worst case scenario, where the biggest difference I got was
a +1.3% increase in processing time[5].
As an aside, DanAck has a version which uses a separate function to do the
concatenation, which should avoid the main performance concern, but might
be a bit harder for existing projects to use.
Thanks,
Craig
[1] https://wiki.php.net/rfc/is_literal
[2] https://github.com/php/php-src/compare/master...krakjoe:literals
[3]
https://github.com/craigfrancis/php-is-literal-rfc/blob/main/tests/001.phpt
[4] https://github.com/php/php-src/blob/master/Zend/micro_bench.php
[5] The times come from 8 alternating runs (4 each), discarding the first 2
runs (warm up), and adding the remaining 3 runs together:
1.354s to 1.367s = +0.013s = 0.96%
1.354s to 1.368s = +0.014s = 1.03%
1.354s to 1.364s = +0.010s = 0.74%
1.357s to 1.374s = +0.017s = 1.25%
1.355s to 1.368s = +0.013s = 0.96%
1.341s to 1.358s = +0.017s = 1.27%
1.354s to 1.367s = +0.013s = 0.96%