Skip to content

gcnyin/leibniz-benchmark

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Speed comparison of Leibniz Formula for π in multiple languages

Based on niklas-heer/speed-comparison.

The original benchmark results cannot reflect the real performance due to the measurement method.

This repo reimplement the benchmark for C++, Java, Golang, Python and JavaScript. I run twenty rounds of benchmarking and count the average time spent on the last ten rounds.

How to run it?

You need to install G++, Golang, OpenJDK 20, GraalVM, Python3, PyPy3, GraalPython, NodeJS, and set the environment variable GRAALVM_HOME.

When you're done configuring, run run.sh.

Results

Testing platform:

  • OS: Ubuntu 22.04
  • CPU: Ryzen 7 5800X

Software version:

  • GCC: 11.4.0
  • Java: 20.0.2
  • GraalVM: Oracle GraalVM for JDK 20.0.2
  • Go: 1.21.0
  • CPython: 3.10.12
  • PyPy: 7.3.9
  • NodeJS: 12.22.9

Results:

raw data

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 34.3%
  • Java 29.6%
  • Shell 9.3%
  • JavaScript 7.4%
  • Go 7.0%
  • Dockerfile 6.4%
  • Python 6.0%