You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When unpacking a generator that yields objects, it takes considerably longer to unpack that generator on PHP 8.1 when compared to PHP 8.0. The regression appears to have been introduced somewhere between 8.1.0alpha2 and 8.1.0alpha3.
On my machine, unpacking the generator full of objects takes roughly 85ms on PHP 7.4.24 and PHP 8.0.21, but that time increases to roughly 165ms on PHP 8.1.8.
Looks like this performance regression has been caused by 52cf7ab.
Indeed. However, that commit looks correct, and I don't see a way to improve the performance without potentially reintroducing the mentioned leaks. And since you could call gc_disable() (and later gc_enable()) to get back the previous performance, I'm closing this as WONTFIX.
Description
When unpacking a generator that yields objects, it takes considerably longer to unpack that generator on PHP 8.1 when compared to PHP 8.0. The regression appears to have been introduced somewhere between 8.1.0alpha2 and 8.1.0alpha3.
On my machine, unpacking the generator full of objects takes roughly 85ms on PHP 7.4.24 and PHP 8.0.21, but that time increases to roughly 165ms on PHP 8.1.8.
Slightly more comprehensive comparison of unpacking vs alternatives
iterator_to_array
andforeach
, with a generator that yields integers and one that yields objects:https://gist.github.com/TRowbotham/322b29b74a07e12532d52ba331a70bd7
PHP Version
8.1.8
Operating System
Ubuntu 20.04
The text was updated successfully, but these errors were encountered: