Switch from 'cut' to 'head'; cut isn't doing what it should here#20
Switch from 'cut' to 'head'; cut isn't doing what it should here#20aklomp merged 1 commit intoaklomp:masterfrom
Conversation
|
Yikes, nice catch. According to I agree that replacing that command with The question I have for you is if you'd like a mention in the copyright header at the top of the file, also in light of your other merge request? I can add one in the rebase. |
|
I don't really know why the I don't mind being left out of the copyright header; I waive all rights to the code contained in this commit. |
Based on the comment on line 66-67, the
cutcommand is supposed to just grab the first 1024 bytes of the file and pass that toawk. Instead, the cut does... something else. I didn't bother figuring out what, but here's some tests that paint the picture:cutcommand chops out some of the file, sure, but not the intended portion (>95% of the file remains) and for my (large) file, it takes 33 seconds to do so.catin the second command is 10x faster than the cut, completing in 3.5 seconds and containing the entire file.headinstead, you get the intended first 1024 bytes and the command completes effectively instantly.This commit moves away from
cutto theheadcommand, which accomplishes the intended file slice and improves performance (particularly on large files).