Eager loading vs. many queries with PHP, SQLite
- by Mike
I have an application that has an n+1 query problem, but when I implemented a way to load the data eagerly, I found absolutely no performance gain. I do use an identity map, so objects are only created once.
Here's a benchmark of ~3000 objects.
first query + first object creation: 0.00636100769043 sec.
memory usage: 190008 bytes
iterate through…