Blog (protip)

@fredwu 11 years ago | 2 min read | no comments
Please also see this blog post on tweaking your ruby GC settings. I use and love DatabaseCleaner, although historically I had never paid too much attention on the performance of its varies cleaning strategies - I’d always used truncation. We use Postgres, and after digging around and finding out the difference between DELETE and TRUNCATE, I ended up improving our test suite speed by about 30-40% simply by tweaking the cleaning strategies. RSpec.configure do |config| config.before :su...
@fredwu 11 years ago | 1 min read | no comments
It was made apparent to me that many ruby devs either aren’t aware or couldn’t be bothered to tweak their ruby garbage collector settings. Well, if you are using MRI, please start tweaking your GC settings. Here’s what I use (on my 15" Macbook Pro Retina): export RUBY_GC_MALLOC_LIMIT=90000000 export RUBY_FREE_MIN=200000 Not only can you tweak it for your local dev machine, you can also tweak Jenkins, Travis CI, Wercker and other CI solutions, making instant speed gain for your test sui...
@fredwu 11 years ago | 2 min read | no comments
I haven’t really used Sequel much therefore I am definitely a newbie. However, after days and nights of frustration, endless debugging and some search-fu during the development of Datamappify, I have finally arrived at the conclusion that Sequel is a capable library, as long as you are aware of the gotchas. Gotcha 1: Always use "select"/"select_all", or your data records will mysteriously have wrong IDs! In ActiveRecord, joining an associated model couldn’t be simpler: Post.joins(:author) ...