C++ vs. Python vs. Perl vs. PHP vs. Java vs. NodeJS vs. Go vs. Ruby vs. Rust vs. Swift vs. D performance benchmark
Switch branches/tags
Nothing to show
Clone or download
famzah Merge pull request #10 from dzaragoza/master
Implementation in the D language
Latest commit 74ff557 Feb 12, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cpp-optimizations Initial commit Feb 4, 2016
dotnet Initial commit. Simple command wrappers Nov 3, 2016
java-optimizations LinkedList info Sep 22, 2016
results Correction of the "C# .NET Core" tests; this time done at full CPU po… Nov 4, 2016
LICENSE Initial commit Feb 4, 2016
README.md
primes-alt.java Limit running time by an ENV variable Sep 7, 2016
primes.cpp Limit running time by an ENV variable Sep 7, 2016
primes.d Port of the Python version to D Jan 27, 2018
primes.dotnet Symlink to the C# .NET Core implementation Nov 3, 2016
primes.go using time.Since Oct 11, 2016
primes.java
primes.js Due to a bug in node.js 4.3, we need to declare and init on separate … Oct 18, 2016
primes.php Limit running time by an ENV variable Sep 8, 2016
primes.pl
primes.py Re-indent using tabs Oct 12, 2016
primes.rb Limit running time by an ENV variable Sep 8, 2016
primes.rs Do not preallocate the vec to the known size so we are fair and do wh… Oct 9, 2016
primes.swift Minor refactoring, so that the code workflow is the same as the other… Jan 12, 2018
run.sh Port of the Python version to D Jan 27, 2018

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:

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/