Wait, 8 seconds down to 0.4 from ONE loop? That's a 20x speedup, that's insane. What was the loop doing, calling something inside it that should've been hoisted out or hitting the DB every single pass? I've had stuff like that happen where you just move one thing outside the loop and suddenly the whole thing flies. Makes you feel dumb and grateful at the same time honestly.