Skip to content

Instantly share code, notes, and snippets.

@xaviershay
xaviershay / ruby_require_speed.patch
Created May 1, 2011 01:00
This drastically speeds up require time on ruby 1.9 (17s down to 10s in our production rails app) , at the expense of disabling some edge case handling around autoloading. YMMV but it works for our rails app.
From 2fb8432982b7e8ffc4c05f912f47cd9ca7261427 Mon Sep 17 00:00:00 2001
From: Xavier Shay <xavier@rhnh.net>
Date: Sun, 1 May 2011 10:25:18 +1000
Subject: [PATCH] Disable some edge cases in requiring to speed it up.
---
load.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/load.c b/load.c
@wbailey
wbailey / databases.rake
Created February 11, 2011 08:58
ActiveRecord migrations outside of Rails
require 'yaml'
require 'logger'
require 'active_record'
namespace :db do
def create_database config
options = {:charset => 'utf8', :collation => 'utf8_unicode_ci'}
create_db = lambda do |config|
ActiveRecord::Base.establish_connection config.merge('database' => nil)