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

Could you update it so that you have "word count\n" on each line?


Like that?


Yep, this is probably the most readable implementation of all languages so far. I ran it and got 3.59s (Go 0.82s, Rust 1.55s, Shell 42.6s(?))

For accurate diff results, one would need `puts` instead of `p` to get rid of the additional quotes.


Checkout Crystal lang one (Ruby but fast), https://github.com/benhoyt/countwords/pull/21/files seems to keep readability intact and committer is saying it outperforms Go which is interesting.


Clocks in at 1.48s for me which is faster than Ruby but slower than JavaScript.


with --no-debug --release ?


    crystal build --no-debug --release simple.cr -o simple-cr




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

Search: