Git Product home page Git Product logo

moekkibux / speed-comparison Goto Github PK

View Code? Open in Web Editor NEW

This project forked from niklas-heer/speed-comparison

0.0 0.0 0.0 1.49 MB

A repo which compares the speed of different programming languages.

License: MIT License

JavaScript 0.61% Ruby 0.40% C++ 6.73% Python 14.06% C 2.13% PHP 0.75% Java 2.58% Lua 0.73% R 0.40% Go 1.05% Rust 3.96% Nim 1.19% Julia 3.21% Crystal 13.37% Swift 0.73% Earthly 38.91% Haskell 4.62% C# 1.10% Ada 2.32% Clojure 1.14%

speed-comparison's Introduction

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
LazyKernel/
LazyKernel
Michael
Michael Abbott
Oscar
Oscar Smith
Páll
Páll Haraldsson
DirkieDurky/
DirkieDurky
Gui
Gui Zhen Wei
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.

speed-comparison's People

Contributors

niklas-heer avatar github-actions[bot] avatar francescoalemanno avatar viscropst avatar frak0d avatar gauteh avatar moelf avatar akaame avatar jonocarroll avatar demonstrandum avatar gbaraldi avatar cyrusmsk avatar joelandman avatar eternalfrustation avatar mattn avatar pallharaldsson avatar oscardssmith avatar mcabbott avatar lazykernel avatar dirkiedurky avatar guizhenwei avatar patrickthedev avatar proudust avatar serioga avatar tacaswell avatar demotomohiro avatar genmeblog avatar mosmeh avatar motoshira avatar yinheli avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.