1. Computing & Technology

Discuss in my forum

Michael Morin

home_run, Dates and Times 20 to 200 Times Faster

By , About.com GuideAugust 23, 2010

Follow me on:

home_run is a gem that implements Ruby's date and time classes in C.  It gives huge performance improvements on parsing dates and times.  The benchmarks in the README are quite impressive, showing and instant and effortless (on your part) speed increase.

But why is this important?  How often do you deal with dates and times?  Directly, you might not deal with them all that often.  However, consider the average Rails project.  How many rows are retrieved from the database and how many of those have created_at and updated_at timestamps?  For each row, ActiveRecord has to parse two dates.  This adds up quick, and actually becomes a problem for many Rails applications.

Comments
No comments yet.  Leave a Comment
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2012 About.com. All rights reserved.

A part of The New York Times Company.