niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

Fortran, this should fix the speed issue #63

Closed francescoalemanno closed 1 year ago

francescoalemanno commented 1 year ago

I run the CI service 2 times using the ubuntu image and now it seems to be working fine...

            +fortran | Started:            
1037
            +fortran | Started:            18-10-2022 21:25:04 
1038
            +fortran | Ended:              18-10-2022 21:25:04 
1039
            +fortran | Language:           Fortran 90 (gfortran) 
1040
            +fortran | Version:            11.2.0 
1041
            +fortran | Executed Command:   ./leibniz
1042
            +fortran | Executed Command:   ./leibniz 
1043
            +fortran | Accuracy:           
1044
            +fortran | Accuracy:           0.5555555555555556 
1045
            +fortran | Calculated Pi:      3.1415926437128880 
1046
            +fortran | Total iterations:   3 
1047
            +fortran | Average time taken: 
1048
            +fortran | Average time taken: 69.107386ms 

vs cpp


                +cpp | Started:            
316
                +cpp | Started:            18-10-2022 21:24:01 
317
                +cpp | Ended:              18-10-2022 21:24:01 
318
                +cpp | Language:           C++ (g++) 
319
                +cpp | Version:            11.2.1 
320
                +cpp | Executed Command:   ./leibniz 
321
                +cpp | Accuracy:           0.7222222222222222 
322
                +cpp | Calculated Pi:      3.1415926635893259 
323
                +cpp | Total iterations:   3 
324
                +cpp | Average time taken: 135.450249ms 
Moelf commented 1 year ago

+fortran | Accuracy: 0.5555555555555556

eh...

francescoalemanno commented 1 year ago

actually the accuracy is not worse:

:::   pi-3.1415926635893259  for CPP
-9.999532757376528e-9

:::   pi-3.1415926437128880 for FORTRAN
9.876905071593e-9
niklas-heer commented 1 year ago

@francescoalemanno I had to update it due to #66

niklas-heer commented 1 year ago

Thank you for your contribution @francescoalemanno 👍