Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The first one ramps up memory use like crazy (which I was trying to avoid) and the second one is much better with memory, but you need to move the sha1_hex into the BEGIN block or you're recomputing the hash for every line parsed, thrashing your CPU. Interesting use of 'shift' though, I didn't know you could modify the file argument to -n like that.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: