No description
  • Earthly 35.6%
  • Python 11.8%
  • Crystal 11.2%
  • Java 6.5%
  • C++ 5.6%
  • Other 29.3%
Find a file
github-actions[bot] fbe72677a2
Some checks are pending
Add contributors / add-contributors (push) Waiting to run
📝 Update contributors
2023-02-05 18:33:35 +00:00
.github/workflows 🙈 Ignore certain files and paths. Fixes #54 2022-10-29 12:40:38 +02:00
assets 📝 Add video how to contribute 2022-10-17 22:40:57 +00:00
results Prepare results directory to store results 2018-02-24 21:59:20 +01:00
scmeta 🐛 Fix pi calculation to be mathematically sound 2022-10-27 01:58:44 +02:00
src Merge pull request #105 from cnuernber/master 2023-02-05 19:33:08 +01:00
.gitignore Added Haskell implementations. 2022-11-12 18:52:12 +00:00
analyze.py Add version to plot 2022-10-26 20:31:21 +02:00
Earthfile Merge pull request #105 from cnuernber/master 2023-02-05 19:33:08 +01:00
earthly-config.yml 🐛 Fix squencial execution problem 2022-10-15 11:34:46 +02:00
LICENSE Initial commit 2018-02-17 16:32:48 +01:00
README.md 📝 Update contributors 2023-02-05 18:33:35 +00:00
requirements.txt Combines the whole analysis step into one Python script 2022-10-03 00:29:48 +02:00

plot


Speed comparison of programming languages

This projects tries to compare the speed of different programming languages. In this project we don't really care about getting a precise calculation of pi. We only want to see how fast are the programming languages doing.
It uses an implementation of the Leibniz formula for π to do the comparison.
Here is a video which explains how it works: Calculating π by hand

You can find the results here: https://niklas-heer.github.io/speed-comparison/

Disclaimer

I'm no expert in all these languages, so take my results with a grain of salt.
Also the findings just show how good the languages can handle floating point operations, which is only one aspect of a programming language.

You are also welcome to contribute and help me fix my possible horrible code in some languages. 😄

Run it yourself

Everything is run by a Docker container and a bash script which envokes the programs.

To measure the execution time a python package is used.

Requirements

Run everything

Earthly allows to run everything with a single command:

earthly --config earthly-config.yml +all

This will run all tasks to collect all measurements and then run the analysis.

Collect data

To collect data for all languages run:

earthly --config earthly-config.yml +collect-data

To collect data for a single languages run:

earthly --config earthly-config.yml +<replace me with language name>

Analyse results

To generate the combined CSV out of all results use this command:

earthly --config earthly-config.yml +analysis

FAQ

Why do you also count reading a file and printing the output?

Because I think this is a more realistic scenario to compare speeds.

Are the compile times included in the measurements?

No they are not included, because when running the program in the real world this would also be done before.

Thanks

The list of Contributors is automatically generated.

Contributors

Niklas
Niklas Heer
Francesco
Francesco Alemanno
Yu
Yu Zhu
Jerry
Jerry Ling
Gaute
Gaute Hope
0xB00B/
0xB00B
Jonathan
Jonathan Carroll
Sıddık
Sıddık AÇIL
S
S Knutsen
Gabriel
Gabriel Baraldi
Serg
Serg Gini
Joe
Joe Landman
Eternal
Eternal Frustation
mattn/
mattn
Chris
Chris Nuernberger
LazyKernel/
LazyKernel
Michael
Michael Abbott
Oscar
Oscar Smith
Páll
Páll Haraldsson
DirkieDurky/
DirkieDurky
Gui
Gui Zhen Wei
Lorenzo
Lorenzo Gabriele
RDPatrickTheDev/
RDPatrickTheDev
Proudust/
Proudust
Sergey
Sergey Trofimov
Thomas
Thomas A Caswell
Tomohiro/
Tomohiro
genmeblog/
genmeblog
Yuta
Yuta Imazu
Kohei
Kohei Hosoki
yinheli/
yinheli

Special thanks

sharkdp

For creating hyperfine which is used for the fundamental benchmarking.

Thomas

This projects takes inspiration from Thomas who did a similar comparison on his blog.