Skip to content

Performance optimization in ScalarColumnHydrator::hydrateAllData()#12095

Merged
derrabus merged 1 commit intodoctrine:3.6.xfrom
maxm86545:patch-1
Aug 11, 2025
Merged

Performance optimization in ScalarColumnHydrator::hydrateAllData()#12095
derrabus merged 1 commit intodoctrine:3.6.xfrom
maxm86545:patch-1

Conversation

@maxm86545
Copy link
Copy Markdown
Contributor

This optimization removes the intermediate array allocation during scalar column hydration. Instead of fetching all numeric rows and extracting the first column via array_column, it now calls fetchFirstColumn() directly. In the context of PDO, this aligns with the driver's native behavior (e.g. Doctrine\DBAL\Driver\PDO\Result::fetchFirstColumn()), allowing the hydration layer to skip redundant copying and memory usage.

@maxm86545
Copy link
Copy Markdown
Contributor Author

Hi. Please note this small change — it went unnoticed despite two releases (3.5.1 and 3.5.2).
@greg0ire @derrabus

@derrabus derrabus changed the base branch from 3.5.x to 3.6.x August 11, 2025 10:19
@derrabus derrabus changed the title perf: Optimizing ScalarColumnHydrator::hydrateAllData Performance-Optimization in ScalarColumnHydrator::hydrateAllData() Aug 11, 2025
@derrabus derrabus changed the title Performance-Optimization in ScalarColumnHydrator::hydrateAllData() Performance optimization in ScalarColumnHydrator::hydrateAllData() Aug 11, 2025
@derrabus derrabus added this to the 3.6.0 milestone Aug 11, 2025
@derrabus
Copy link
Copy Markdown
Member

Thank you.

@derrabus derrabus merged commit c1f7a60 into doctrine:3.6.x Aug 11, 2025
85 checks passed
@maxm86545 maxm86545 deleted the patch-1 branch September 8, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants