Want to stay on top? Ruby Weekly is a once-weekly e-mail newsletter covering the latest Ruby and Rails news.
     Feed Icon

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.

Comments

  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 http://third-base.rubyforge.org and http://github.com/rtomayko/date-performance

Other Posts to Enjoy

Twitter Mentions