.

Coffee Powered

code and content

Tag Archives: performance

Announcing Scrap

I do a lot of memory and garbage analysis on my Rails apps, and in upgrading to Rails 2.3, I discovered a practical use for the new Rails Metal middleware. Dumping memory stats to my log was just sorta unreadable in a practical scenario, and was more or less entirely unusable in production. Fortunately, Metal [...]

Mass inserting data in Rails without killing your performance

Mass inserting is one of those operations that isn’t really well-supported by ActiveRecord, but which has to be done nonethless. You might say, “Well hey, I’ll just run a loop and create a bunch of AR objects, no sweat”. That’ll work, but if speed is a factor, it might not be your best option. ActiveRecord [...]

Quick tip – use anonymous blocks!

In tracking down a memory leak in one of our Rails apps today, I ran across an interesting post detailing the difference between anonymous and named blocks in Ruby, and the performance differences therein. It’s definitely worth a look, especially if you’re running in a complex environment, where new closures will be large and unwieldy. [...]