|
2 years ago | |
---|---|---|
cpp-optimizations | 7 years ago | |
dotnet | 3 years ago | |
java-optimizations | 7 years ago | |
results | 3 years ago | |
LICENSE | 7 years ago | |
README.md | 5 years ago | |
primes-alt.java | 2 years ago | |
primes-alt.lua | 2 years ago | |
primes.cpp | 3 years ago | |
primes.d | 5 years ago | |
primes.dotnet | 6 years ago | |
primes.erl | 3 years ago | |
primes.go | 3 years ago | |
primes.java | 2 years ago | |
primes.js | 3 years ago | |
primes.lua | 3 years ago | |
primes.php | 3 years ago | |
primes.pl | 3 years ago | |
primes.py | 3 years ago | |
primes.rb | 7 years ago | |
primes.rs | 3 years ago | |
primes.swift | 5 years ago | |
run.sh | 5 years ago |
README.md
langs-performance
C++ vs. Python vs. Perl vs. PHP vs. Java vs. NodeJS vs. Go vs. Ruby vs. Rust vs. Swift vs. D performance benchmark
Blog articles:
- 2016: https://blog.famzah.net/2016/09/10/cpp-vs-python-vs-php-vs-java-vs-others-performance-benchmark-2016-q3/
- 2016: https://blog.famzah.net/2016/02/09/cpp-vs-python-vs-perl-vs-php-performance-benchmark-2016/
- 2010-2012: https://blog.famzah.net/2010/07/01/cpp-vs-python-vs-perl-vs-php-performance-benchmark/
The benchmarks here do not try to be complete, as they are showing the performance of the languages in one aspect, and mainly: loops, dynamic arrays with numbers, basic math operations.
The times include the interpretation/parsing phase for each language, but it’s so small that its significance is negligible. The programs run for 90 wall-clock seconds and there are 6 identical runs, in order to have more reliable results. All scripts are using the very same algorithm to calculate the prime numbers in a given range. The correctness of the implementation is not so important, as we just want to check how fast the languages perform. The original Python algorithm was taken from http://www.daniweb.com/code/snippet216871.html.
Another similar project: https://benchmarksgame.alioth.debian.org/