On Feb 26, 2006, at 02:17, James Edward Gray II wrote:

> 1.  Be significantly faster than CSV while remaining a pure Ruby 
> library.

Couldn't resist the temptation to check how much faster 8^)

Here are some numbers parsing ip-to-country.csv (3MB, 63726 lines)[1].


[ruby csv]
% ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin7.9.0]
% /usr/bin/time ruby TestCSV.rb
        79.06 real        74.42 user         0.30 sys


[ruby faster_csv]
% ruby -v
ruby 1.8.4 (2005-12-24) [powerpc-darwin7.9.0]
% /usr/bin/time ruby TestFasterCSV.rb
         7.56 real         7.16 user         0.19 sys


[lua LUCSV][2][3]
% lua -v
Lua 5.1  Copyright (C) 1994-2006 Lua.org, PUC-Rio
% /usr/bin/time lua TestCSV.lua
         2.79 real         2.45 user         0.09 sys


[python csv][4][5]
% python -V
Python 2.4.2
% /usr/bin/time python TestCSV.py
         0.85 real         0.79 user         0.04 sys


Cheers

--
PA, Onnay Equitursay
http://alt.textdrive.com/


[1] http://ip-to-country.webhosting.info/node/view/6
[2] http://www.lua.org/about.html
[3] http://dev.alt.textdrive.com/browser/lu/LUCSV.lua
[4] http://www.python.org/doc/2.4.2/lib/module-csv.html
[5] Python provides a C implementation of the CSV parser.