Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
80 lines (63 sloc) 1.96 KB

Modpow Project Results

Time findings

Here are the results of the times gathered when using different languages:

Rust:

324322^(10000000) mod 3724 = 2956
324322^(20000000) mod 3724 = 1432
324322^(30000000) mod 3724 = 2528
324322^(40000000) mod 3724 = 2424
324322^(50000000) mod 3724 = 368
324322^(60000000) mod 3724 = 400
324322^(70000000) mod 3724 = 1892
324322^(80000000) mod 3724 = 3028
324322^(90000000) mod 3724 = 1996

real        0m2.005s
user        0m2.003s
sys 0m0.002s

C

324322^(10000000) mod 3724 = 2956
324322^(20000000) mod 3724 = 1432
324322^(30000000) mod 3724 = 2528
324322^(40000000) mod 3724 = 2424
324322^(50000000) mod 3724 = 368
324322^(60000000) mod 3724 = 400
324322^(70000000) mod 3724 = 1892
324322^(80000000) mod 3724 = 3028
324322^(90000000) mod 3724 = 1996

real    0m4.604s
user    0m4.602s
sys     0m0.003s

C with -O3 flag (Optimization Level 3)

324322^(10000000) mod 3724 = 2956
324322^(20000000) mod 3724 = 1432
324322^(30000000) mod 3724 = 2528
324322^(40000000) mod 3724 = 2424
324322^(50000000) mod 3724 = 368
324322^(60000000) mod 3724 = 400
324322^(70000000) mod 3724 = 1892
324322^(80000000) mod 3724 = 3028
324322^(90000000) mod 3724 = 1996

real        0m1.836s
user        0m1.835s
sys 0m0.001s

Python

324322^(10000000) mod 3724 = 2956
324322^(20000000) mod 3724 = 1432
324322^(30000000) mod 3724 = 2528
324322^(40000000) mod 3724 = 2424
324322^(50000000) mod 3724 = 368
324322^(60000000) mod 3724 = 400
324322^(70000000) mod 3724 = 1892
324322^(80000000) mod 3724 = 3028
324322^(90000000) mod 3724 = 1996

real        0m36.372s
user        0m34.996s
sys 0m1.380s

Comparison

Rank Language Time
1 C -O3 1.835s
2 Rust 2.003s
3 C 4.602s
4 Python 34.996s