Better Ruby Rounding

By Brian Hempel

Need to round to the nearest 30 minutes or up to the next 250 or some other fun rounding case? Ruby’s build-in round, floor, and ceil won’t help you, but the Rounding gem will.

Streaming Data From Postgresland to Rubyland

By Brian Hempel

I recently gave a talk covering find\_each, pluck, and the PostgreSQL Cursor gem for the West Michigan Ruby Users Group.

Optimizing Rails for Memory Usage Part 4: Lazy JSON Generation and Final Thoughts

By Brian Hempel

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

By Brian Hempel

Some ways to reduce memory usage as you gather records out of your database into Rubyland.

Optimizing Rails for Memory Usage Part 1: Before You Optimize

By Brian Hempel

Part one of a four-part series which will show you how to optimize a memory-heavy Rails API action.

Optimizing Rails for Memory Usage Part 2: Tuning the GC

By Brian Hempel

Changing Ruby’s garbage collection parameters is the least invasive way to optimize your app’s memory usage.

Why Isn't Ruby Rescuing My Exception?

By Brian Hempel

By default, Ruby only rescues subclasses of StandardError to allow the really bad stuff to halt your program.

Benchmarking Rails on the Retina MacBook Pro

By Brian Hempel

How much of a speed boost is the new Retina MacBook Pro’s Ivy Bridge i7? A lot–if you’re coming from a Core 2 Duo!