Sunday, October 30, 2005

Get 10-15% more performance with MySQL/Rails

Posted by admin

Rails 0.14.x and forward contains a hefty performance increase for the MySQL adapter, but it requires that you have the latest version of the underlying, native bindings (2.7). On Stephan Kaes’ benchmark suite, the upgrade is 10-15%:

You can get the latest MySQL bindings with gem install mysql (or gem install mysql -- --include=/usr/local/lib on OS X). The additional speed upgrade will automatically kick in as soon as you have the latest bindings (to check, open the console, require ‘mysql’, puts Mysql::VERSION, and expect to see 20700).

UPDATE: If you’re on Windows, Justin Rudd went through the trouble of describing how to make it work there.