3 ms·
Multi-file wordcount – an exercise in concurrent Ruby
- jchook 8y agoHey despite the poor performance this post taught me a lot about Ruby. Thanks! 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 }