3 ms·
The Ruby implementation looks wrong. He's shoving the file into an array: contents = contents.read.each_byte.to_a When really he should be streaming each by
by misterbowfinger 8y ago
The Ruby implementation looks wrong. He's shoving the file into an array:
contents = contents.read.each_byte.to_a
When really he should be streaming each byte from the file. I suppose he should do that for all of the implementations (or just use grep & cat?), but Ruby objects are annoyingly expensive since there's so much bloat.