Optimizing Rails for Memory Usage Part 4: Lazy JSON Generation and Final Thoughts
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.
Optimizing Rails for Memory Usage Part 3: Pluck and Database Laziness
Some ways to reduce memory usage as you gather records out of your database into Rubyland.
Test Your API with Cucumber and json_spec
At Collective Idea, we do a lot of work with RESTful JSON APIs. They can be a joy to build but a pain to test. We’re currently working on a project that’s all API all the time, so we developed some reusable Cucumber steps for testing. Now, we’ve abstracted all that goodness out into its own gem… json_spec.