mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-894: Performance improvement in AbstractQuery: Cache should be checked *before* flushing the unit of work, not after doing it #1111
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 25, 2010).
Jira issue originally created by user dalvarez:
In /Doctrine/ORM/AbstractQuery.php, starting on line 490, the unit of work is flushed
if needed before processing the query:
If there is a subsequent cache hit, this turns out to be unnecessary later.
Checking the cache first and flushing the unit of work only on cache misses could increase
performance significantly in some scenarios (batch-jobs that are heavy on inserts) and does not cost a dime.
Otherwise the ORM is performing a significant amount of non-work, when we
could as well happily continue feeding the unit of work.