Skip to content

FORK App for benchmarking Ruby CSV libraries

Notifications You must be signed in to change notification settings

jpmckinney/csv-benchmark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV Benchmark

Benchmark

brew install libcsv
bundle
ruby benchmark.rb
ruby benchmark.rb <csv file>
ruby benchmark.rb --only-fast
ruby benchmark.rb --only-fastest

Evaluates:

  • fastcsv: fast and full CSV support
  • rcsv: fast, but differs in behavior from Ruby's CSV
  • excelsior: fast, but fails several edges cases
  • fastest-csv: fast, but incorrectly parses multiline fields
  • ccsv: fast, but incorrectly parses quoted fields, including multiline fields
  • bamfcsv: not as fast, but best error handling
  • lightcsv: as slow as standard library
  • smarter_csv: slower than standard library
  • fasterer-csv: errors on valid input

Output from running only fastest on OpenlyLocal's 1.2G CSV of council spending (83MB ZIP):

user         system      total     real
csv          84.990000   0.930000  85.920000 ( 85.998271)
excelsior    35.370000   0.860000  36.230000 ( 36.601276)
ccsv         15.890000   0.680000  16.570000 ( 16.685589)
fastcsv      18.840000   0.760000  19.600000 ( 19.680719)
fastest-csv  15.310000   0.740000  16.050000 ( 16.108917)
rcsv         22.290000   1.260000  23.550000 ( 24.238066)

Test files from original repository:

Compatibility

Tests the fastcsv, rcsv, bamfcsv, excelsior, fastest-csv and ccsv CSV implementations:

ruby csv_spec.rb

About

FORK App for benchmarking Ruby CSV libraries

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%