Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news.

home_run: Ruby’s Date and DateTime Classes, But 20-200x Faster

By Peter Cooper / August 23, 2010

home_run is an implementation of ruby’s Date/DateTime classes in C, with much better performance (20-200x) than the version in the standard library, while being almost completely compatible.

Jeremy Evans

Jeremy Evans (of Sequel fame) has created home_run, a performance-focused C reimplementation of Ruby's Date and DateTime classes. They work out to be significantly faster than the native Ruby classes while retaining compatibility (mostly).

Jeremy makes the surprising claim that "the standard library Date class is slow enough to be the bottleneck in much (if not most) of code that uses it", but goes on to prove the point with a Rails related benchmark where retrieving all objects for two different models gets a 2x and 3x speedup with home_run loaded.

I hope that Jeremy ultimately aims to get his work included into MRI (as happened with FasterCSV replacing CSV in the stdlib) as standard.


  1. roger says:

    practically impossible to leave a comment on this one since clicking on the title takes you straight to the github page.

  2. roger says:

    So is this faster/equal to and

Other Posts to Enjoy

Twitter Mentions