3 ms·
Author is using Rails, so my guess would be the bottleneck is ActiveRecord. I've never used ActiveRecord, so I can't speak to it directly, but in my experience
by luhn 6y ago
Author is using Rails, so my guess would be the bottleneck is ActiveRecord. I've never used ActiveRecord, so I can't speak to it directly, but in my experience when dealing with large numbers of records in an ORM (and author easily is working with hundreds of thousands), things grind to a halt, even with eager loading. There's a lot more overhead to create thousands of ORM objects than it is to serialize an equivalent chunk of BSON.
- treeman79 6y agoBulk operations are were a lot of rails programmers struggle. Active record is awesome in many ways, but it can shoehorn you into n+1 solutions.
- vidugavia 6y ago12k is not a large number of records though
- luhn 6y ago12k episodes, each with cast list and reviews. That's easily hundreds of thousands of records, possibly millions.