Performance optimization ideas for PHP 7.3
| From: | Nicolas Grekas | Date: | Thu, 19 Apr 2018 14:10:20 +0000 |
| Subject: | Performance optimization ideas for PHP 7.3 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-102055@lists.php.net to get a copy of this message | ||
Hello internals,
During the last months, I've been working on optimizing Symfony/Twig for
PHP7.
I found a few situations where the PHP engine could likely be optimized,
and where it would benefit real-world apps.
In each case, these might look like micro-optimizations, but they are not
in hot loops.
Here are the links to issues I created in the php bug tracker:
- Class constants are slow: they should be inlined at runtime -
https://bugs.php.net/76178
- Add array_key_exists() to the list of specialy compiled functions -
https://bugs.php.net/76148
- Don't trigger copy-on-write when assigning same value -
https://bugs.php.net/76150
As a bonus, I also created this one today:
- Add hrtime() to zend_try_compile_special_func() -
https://bugs.php.net/76241
It would be awesome if those ideas could be implemented in a future PHP
version.
(I'm sorry I don't have the knowledge to do it myself.)
Keep up the good work!
Nicolas