svercl / countwords

Playing with counting word frequencies (and performance) in various languages.

Home Page:https://benhoyt.com/writings/count-words/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Playing with counting word frequencies (and the performance thereof) in various languages. See the full article for context and background: https://benhoyt.com/writings/count-words/

NOTE

I received dozens of pull requests when my count-words article first came out, almost to the point where I couldn't keep up with them. Thanks for all the submissions!

However, I'm not taking new submissions anymore, due mainly to the amount of time I've spent on this already. The major languages are there, and many minor ones. However, I'm still open to receiving feedback -- you can either email me (via the email address on my website) or open an issue here. Thanks!

To run the benchmarks

To run the tests and benchmarks (you'll need Go, Rust, Python 3, AWK and perhaps other tools installed). Only tested on Linux:

./test.sh
./benchmark.py

For the latest results (run on my machine against these versions), see the article's performance results section.

Credits

Thanks to these contributors for additional language versions:

See other versions on Rosetta Code.

About

Playing with counting word frequencies (and performance) in various languages.

https://benhoyt.com/writings/count-words/

License:MIT License


Languages

Language:Rust 24.1%Language:Go 16.1%Language:Shell 11.3%Language:C 6.6%Language:Java 5.2%Language:Forth 5.2%Language:Python 4.7%Language:C# 4.5%Language:Zig 3.8%Language:C++ 2.9%Language:Nim 2.0%Language:Haskell 1.9%Language:JavaScript 1.9%Language:F# 1.5%Language:Lua 1.2%Language:Pascal 1.2%Language:D 1.1%Language:Common Lisp 0.9%Language:OCaml 0.7%Language:Ruby 0.5%Language:Perl 0.4%Language:Tcl 0.4%Language:PHP 0.3%Language:Julia 0.3%Language:Kotlin 0.3%Language:Swift 0.3%Language:Awk 0.3%Language:Crystal 0.2%