I recently gave a talk covering
pluck, and the PostgreSQL Cursor gem for the West Michigan Ruby Users Group.
Code to copy-paste so you can lazily serialize JSON and maybe even stream it to the client, and an argument for why we shouldn’t have to do any of this.
Some ways to reduce memory usage as you gather records out of your database into Rubyland.
Part one of a four-part series which will show you how to optimize a memory-heavy Rails API action.
Changing Ruby’s garbage collection parameters is the least invasive way to optimize your app’s memory usage.