- last update
over 1 year ago Fetch Error - Status changed to Closed: cannot reproduce
5 days ago 3:47pm 1 April 2025 - 🇷🇺Russia walkingdexter
This is not an issue anymore (tested locally with
performance_test.php
). Yeah, the memory usage grows with the amount of data in the sitemap, but I couldn't find any correlation withyieldItem()
, even if we select one element at a time from the queue. It must be related to something else. - 🇵🇱Poland dmitry.korhov Poland, Warsaw
I disagree with closing.
The problem is still there - loading all items at once.
It should be split into chunks or batches. - 🇷🇺Russia walkingdexter
I disagree with closing.
The problem is still there - loading all items at once.
It should be split into chunks or batches.@dmitry.korhov Ok. Please provide a detailed explanation of how to see the benefit of the proposed changes. Also keep in mind that with these changes half of the links will not be included in the sitemap.
If you look closely at the current implementation of
yieldItem()
, you will see that the items are not loaded all at once, because we usefetchObject()
. In the case of MySQL, the important thing is buffered queries. However, in my testing I found no correlation with memory consumption (Drupal 10.4, PHP 8.1, MySQL 8.0). The proposed changes also have no effect.It's possible that the improvement has already been implemented at the core level. See 🐛 Implement statement classes using \Iterator to fix memory usage regression and prevent rewinding Fixed for details.