Multi-file wordcount – an exercise in concurrent Ruby
recurse.henrystanley.com
recurse.henrystanley.com
I did wonder.. doesn’t readlines load the entire file into RAM? Would it be more performance to try, e.g.
File.open(filename).inject(0) { |c, line| c + 1 }