Skip to content

simple program to benchmark different compiler performance.

License

Notifications You must be signed in to change notification settings

Raymond-CL/compiler_bench

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compiler_bench

Simple program to benchmark different compiler performance.
Current algorithm is the Pi(n) function.
which is finding the number of prime numbers less than n.
For following compilers are tested:

Language Compiler Flags time in secs (N=5000000) timer
Fortran gfortran -O3 0.923 system_clock
C++ g++ -O3 0.929 chrono
Haskell ghc -O2 3.860 Data.Time
Rust rustc -C opt-level=3 0.940 Instant
Python cython3 + gcc -O2 17.73 time
Julia

unit: Microsoft Surface Pro 9
system: Ubuntu 24.04 x86-64, Linux 5.15-microsoft-standard-WSL2, Windows 11
hardware: Intel i7-1255U, 2600Mhz, 2P+8E Cores, 8GB RAM

Note: The .py python script file is first converted to .c using cython3, then compiled as a standalone executable using gcc compiler.
Haskell time resolution might be wrong for WSL2, see this article.

I tried to compile all the codes, then run them simultaneously by opening a new shell for each executable.
Not very elegant, you might have to uncomment this option in Makefile.

About

simple program to benchmark different compiler performance.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published