Stop Blaming Doctrine - Start Understanding It
dev.to·22h·
Discuss: DEV
Flag this post

Every few months, someone on the team sighs during a retrospective and says the words that make me reach for coffee:

“Doctrine is slow.”

No, it’s not. Doctrine is an ORM. It does exactly what you tell it to do. The problem is - most developers don’t realise how much they’re telling it to do.

This post isn’t a tutorial. It’s a field report from someone who’s watched Doctrine crawl through millions of rows... and then, after a few lines of code change, fly through them using less memory than Chrome with two tabs open.


Scene 1: The 900 MB Disaster

A CLI command meant to clean up stale product records. Half a million entities. Nothing fancy. Just iterate and tweak a few fields.

$products = $this->repository->createQueryBuilder('p')
->getQuery()
->toIter...

Similar Posts

Loading similar posts...