News for hackers. Stuff that matters.
Re:Performance comparison: counting words in Python, Go, C++... by bestinterest on Monday March 15, 2021 @11:23AM (#26467078)
Like that?
Re:Performance comparison: counting words in Python, Go, C++... by frankenst1 on Monday March 15, 2021 @11:58AM (#26467567)
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.

Re:Performance comparison: counting words in Python, Go, C++... by bestinterest on Monday March 15, 2021 @12:29PM (#26468066)
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.
Re:Performance comparison: counting words in Python, Go, C++... by frankenst1 on Monday March 15, 2021 @12:52PM (#26468388)
Clocks in at 1.48s for me which is faster than Ruby but slower than JavaScript.
Re:Performance comparison: counting words in Python, Go, C++... by derjames on Monday March 15, 2021 @10:14PM (#26472094)
with --no-debug --release ?
Re:Performance comparison: counting words in Python, Go, C++... by frankenst1 on Tuesday March 16, 2021 @09:36AM (#26476483)

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