Skip to content

Instantly share code, notes, and snippets.

@mirakui
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mirakui/33510a29aba64a142911 to your computer and use it in GitHub Desktop.
Save mirakui/33510a29aba64a142911 to your computer and use it in GitHub Desktop.
Comparing standard CSV library in go and ruby
  • big.csv (1.3GB)
  • Macbook Air 11-inch, Mid 2011
    • CPU: 1.8 GHz Intel Core i7
    • Memory: 4 GB 1333 MHz DDR3

https://github.com/mirakui/hello_world/blob/master/go/csv_counter.go

$ time ./csv_counter big.csv
lines: 3502066
columns: 84049584
./csv_counter   56.40s user 1.31s system 99% cpu 57.982 total

https://github.com/mirakui/hello_world/blob/master/go/csv_counter.rb

$ time ruby ./csv_counter.rb big.csv
lines: 3502066
columns: 84049584
ruby ./csv_counter.rb   327.26s user 1.87s system 99% cpu 5:31.02 total
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment