Skip to content

Commit c2b3d02

Browse files
committed
updated results for rust and cpp
1 parent 00c010e commit c2b3d02

File tree

9 files changed

+47
-31
lines changed

9 files changed

+47
-31
lines changed

C/build-new.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
3+
gcc main.c -Ofast -march=native -mtune=native -ffast-math -o output.exe

C/result-old.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Benchmark 1: ./a.out
2+
Time (mean ± σ): 61.831 s ± 1.884 s [User: 61.762 s, System: 0.003 s]
3+
Range (min … max): 61.202 s … 67.192 s 10 runs
4+

C/result.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Benchmark 1: ./a.out
2-
Time (mean ± σ): 61.831 s ± 1.884 s [User: 61.762 s, System: 0.003 s]
3-
Range (min … max): 61.202 s … 67.192 s 10 runs
1+
Benchmark 1: ./output.exe
2+
Time (mean ± σ): 62.849 s ± 0.016 s [User: 62.753 s, System: 0.010 s]
3+
Range (min … max): 62.832 s … 62.887 s 10 runs
44

Cpp/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
g++ main.cpp -O3 -s -static -flto -march=native -mtune=native -fomit-frame-pointer -fno-signed-zeros -fno-trapping-math -fassociative-math -ffast-math
3+
g++ main.cpp -Ofast -march=native -mtune=native -ffast-math -o output.exe

Cpp/result-1kk.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Benchmark 1: ./output.exe
2+
Time (mean ± σ): 20.2 ms ± 0.3 ms [User: 19.0 ms, System: 1.6 ms]
3+
Range (min … max): 19.8 ms … 21.9 ms 100 runs
4+

Cpp/result.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Benchmark 1: ./a.out
2-
Time (mean ± σ): 30.497 s ± 0.074 s [User: 30.464 s, System: 0.001 s]
3-
Range (min … max): 30.376 s … 30.671 s 10 runs
1+
Benchmark 1: ./output.exe
2+
Time (mean ± σ): 18.475 s ± 0.164 s [User: 18.444 s, System: 0.005 s]
3+
Range (min … max): 18.284 s … 18.721 s 10 runs
44

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ All benchmarks made with different random engines. It's more comparison of imple
1414
| :---: | ----------- | ------------------ | ----------------- | -------- | -------------------- |
1515
| 1 | Nim | nim 1.6.6 | 6.8 ± 0.9 | 1 | :star: |
1616
| 2 | Zig | 0.11.0 | 7.4 ± 0.7 | 1.09 | :shit: |
17-
| 3 | Beef | BeefBuild 0.43.5 | 13.9 ± 0.6 | 2.04 | :shit: :shit: |
18-
| 4 | Crystal | 1.6.2 | 18.1 ± 1.1 | 2.66 | :star: |
19-
| 5 | Odin\* | nightly-2022-12-12 | 22.1 ± 1.3 | 3.25 | :shit: :shit: |
20-
| 6 | Rust | rustc 1.65 | 22.7 ± 1.3 | 3.34 | :star: :star: :star: |
21-
| 7 | D | ldc2 1.30 | 29.5 ± 0.9 | 4.34 | :star: :star: |
22-
| 8 | Ada | gnatmake-gcc 12.2 | 29.8 ± 1.0 | 4.38 | :star: |
23-
| 9 | C++ | g++ 12.2 | 31.9 ± 1.5 | 4.69 | :shit: :shit: |
17+
| 3 | Rust | rustc 1.65 | 9.3 ± 0.5 | 1.36 | :star: :star: :star: |
18+
| 4 | Beef | BeefBuild 0.43.5 | 13.9 ± 0.6 | 2.04 | :shit: :shit: |
19+
| 5 | Crystal | 1.6.2 | 18.1 ± 1.1 | 2.66 | :star: |
20+
| 6 | C++ | g++ 12.2 | 20.2 ± 0.3 | 2.97 | :shit: :shit: |
21+
| 7 | Odin\* | nightly-2022-12-12 | 22.1 ± 1.3 | 3.25 | :shit: :shit: |
22+
| 8 | D | ldc2 1.30 | 29.5 ± 0.9 | 4.34 | :star: :star: |
23+
| 9 | Ada | gnatmake-gcc 12.2 | 29.8 ± 1.0 | 4.38 | :star: |
2424
| 10 | V | v 0.3.2 | 34.3 ± 0.8 | 5.04 | :shit: |
2525
| 11 | Fortran | gfortran 12.2 | 44.2 ± 1.6 | 6.5 | :ok: |
2626
| 12 | Haskell | ghc 9.2.5 | 54.6 ± 3.3 | 8.03 | :shit: :shit: :shit: |
@@ -57,12 +57,12 @@ All benchmarks made with different random engines. It's more comparison of imple
5757
| 4 | Rust | rustc 1.65 | 8.369 | 1.35 |
5858
| 5 | Beef | BeefBuild 0.43.5 | 12.599 | 2.04 |
5959
| 6 | Crystal | 1.6.2 | 15.703 | 2.54 |
60-
| 16 -> 7 | C# | dotnet 7 | 20.361 | 3.29 |
61-
| 8 | Odin\* | nightly-2022-12-12 | 20.548 | 3.32 |
62-
| 20 -> 9 | F# | dotnet 7 | 25.438 | 4.12 |
63-
| 10 | D | ldc2 1.30 | 26.952 | 4.36 |
64-
| 11 | Ada | gnatmake-gcc 12.2 | 28.702 | 4.64 |
65-
| 12 | C++ | g++ 12.2 | 30.376 | 4.92 |
60+
| 7 | C++ | g++ 12.2 | 18.284 | 2.95 |
61+
| 16 -> 8 | C# | dotnet 7 | 20.361 | 3.29 |
62+
| 9 | Odin\* | nightly-2022-12-12 | 20.548 | 3.32 |
63+
| 20 -> 10 | F# | dotnet 7 | 25.438 | 4.12 |
64+
| 11 | D | ldc2 1.30 | 26.952 | 4.36 |
65+
| 12 | Ada | gnatmake-gcc 12.2 | 28.702 | 4.64 |
6666
| 13 | V | v 0.3.2 | 32.299 | 5.23 |
6767
| 19 -> 14 | JS/TS\*\*\* | node.js | 40.573 | 6.57 |
6868
| 15 | Fortran | gfortran 12.2 | 41.625 | 6.74 |

Rust/result-1kk.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Benchmark 1: ./Rust
2+
Time (mean ± σ): 9.3 ms ± 0.5 ms [User: 8.6 ms, System: 1.3 ms]
3+
Range (min … max): 8.9 ms … 13.5 ms 1000 runs
4+

compilation-keys.txt

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
Nim nim c --verbosity:0 -d:danger --passC:"-flto" --passL:"-flto" --gc:arc <file-name>
2+
Julia julia -O3 --math-mode=ieee <file_name>
23
Zig zig build-exe -OReleaseFast <file_name>
4+
Rust RUSTFLAGS="-C target-cpu=native" cargo build --release , but custom release profile in cargo.toml
35
Beef BeefBuild -config=Release
46
Crystal crystal build <file_name> --release
7+
C++ g++ <file_name> -Ofast -march=native -mtune=native -ffast-math
8+
C# dotnet build -c Release --no-self-contained
59
Odin odin build <file_name> -file -opt:3
6-
Rust RUSTFLAGS="-C target-cpu=native" cargo build --release , but custom release profile in cargo.toml
10+
F# dotnet build -c Release --no-self-contained
711
D ldc2.exe -O3 -release -mcpu=native -march=x86-64 -flto=full -static -ffast-math <file_name>
812
Ada gnatmake -O3 -fomit-frame-pointer -march=native -gnatNp -f <file_name>
9-
C++ g++ <file_name> -O3 -s -static -flto -march=native -mtune=native -fomit-frame-pointer -fno-signed-zeros -fno-trapping-math -fassociative-math -ffast-math
1013
V v -prod <file_name>
14+
JS/TS node <file_name>
1115
Fortran gfortran -O3 -march=native -ipo -static -qopenmp <file_name>
12-
Haskell stack build
1316
C gcc <file_name> -O3 -s -static -flto -march=native -mtune=native -fomit-frame-pointer -fno-signed-zeros -fno-trapping-math -fassociative-math -ffast-math
1417
Go go build <file_name>
1518
Pascal fpc -XXs -O3 -Ci- -Cr- -g- -CpCOREAVX -CfAVX <file_name>
16-
C# dotnet build -c Release --no-self-contained
17-
Kotlin (Native) kotlinc -opt <file_name>, but better to compile from IDEA
18-
Dart dart compile exe <file_name>
19-
JS/TS node <file_name>
20-
F# dotnet build -c Release --no-self-contained
2119
Java built from IDEA
2220
Kotlin (JVM) built from IDEA
21+
Kotlin (Native) kotlinc -opt <file_name>, but better to compile from IDEA
22+
Dart dart compile exe <file_name>
2323
Python python -OO <file_name>
24-
Julia julia -O3 --math-mode=ieee <file_name>
25-
R rscript <file_name>
24+
Perl perl <file_name>
2625
Ruby ruby <file_name>
27-
Prolog swipl -nodebug -g true -O --goal=main --stand_alone=true -o main.exe -c <file_name>
2826
Elixir elixir <file_name>
27+
Prolog swipl -nodebug -g true -O --goal=main --stand_alone=true -o main.exe -c <file_name>
28+
Haskell stack build
29+
R rscript <file_name>
2930
PowerShell ./<file_name>

0 commit comments

Comments
 (0)