2 ms·
Yeah, profiling helps a little. It taught me that queries flush (and you can easily go n^2 from that if you're not careful). More recently, we've had n+1 issue
by dunham 9y ago
Yeah, profiling helps a little. It taught me that queries flush (and you can easily go n^2 from that if you're not careful).
More recently, we've had n+1 issues (putting a printing breakpoint in EntityType.loadByUniqueKey helped me track down where). My hack to get around that was to do a bulk Criteria query up front to pre-load the session cache with the entities that were being fetched one at a time.
There were a lot of quirks that I've had to learn over the last decade, and I'm still discovering more.