# Improving Fortran Results in the Julia Micro-benchmarks

**URL:** <https://fortran-lang.discourse.group/t/improving-fortran-results-in-the-julia-micro-benchmarks/198>\
**Category:** Help\
**Created:** [July 8, 2020, 2:39pm UTC](https://fortran-lang.discourse.group/t/improving-fortran-results-in-the-julia-micro-benchmarks/198 "2020-07-08T14:39:56Z")\
**Posts on this page:** 1\
**Showing post:** 27

<div class="post-metadata">

**Author:** ![FortranFan](https://avatars.discourse-cdn.com/v4/letter/f/96bed5/32.png) [@FortranFan](https://fortran-lang.discourse.group/u/FortranFan)\
**Post date:** [April 30, 2022, 5:37pm UTC](https://fortran-lang.discourse.group/t/improving-fortran-results-in-the-julia-micro-benchmarks/198/27 "2022-04-30T17:37:42Z")

</div>

It is interesting in this [**thread**](https://fortran-lang.discourse.group/t/why-is-my-code-compiled-with-gfortran-on-windows-slower-than-on-ubuntu/1666/30), @mecej4 writes:

> [@Why is my code compiled with GFortran on Windows slower than on Ubuntu?](https://fortran-lang.discourse.group/t/why-is-my-code-compiled-with-gfortran-on-windows-slower-than-on-ubuntu/1666/30):
>
> … Before joining this forum, I had barely heard of Julia. Some of the posts in fortran-lang.discourse named Julia as a threat to Fortran, so I searched and read some articles claiming that Julia was xxx times faster than Fortran, etc. I felt that the claims were not credible, and wanted to give Julia a test-drive. I downloaded the 1.7.2 distribution for Windows, and ran a few examples of nonlinear regression.
> 
> The Fortran version compiles and links in ~ 2 seconds, and the run takes less than a second. A second run of the EXE takes 0.04 s, since the DLLs are now cached. The Julia version took 25 seconds for the first run, of which 17 s were used to process the directive **using PyPlot**. A second run while staying within the Julia REPL took 0.4 s. What disappointed me was the inability to compile stable source code into object files, EXEs and libraries and the huge startup time for running any Julia program unless one stays inside the REPL.

I had a very similar experience a couple of years ago when this thread by @lkedward first caught my attention. I do feel good to know I am not the only one who came away with the same impression as @mecej4 on Julia.

I was aware of Julia as a possibly leading contender in the near future in the HPC domain but had not looked into it until this thread surfaced here.

In addition to the comments by @mecej4 , I felt many of the claims among the Julia crowd were based on the microbenchmarks that were setup by the ardent users of Julia. But so many of those microbenchmarks were highly questionable in my opinion, especially when it came to other languages used in their comparisons. Honestly, the codes used in the microbenchmarks are poorer than beginner level.

I personally don’t think [**code**](https://github.com/JuliaLang/Microbenchmarks/blob/master/perf.f90) such as the following to reveal anything useful, let alone be a measure for anything. But this is what the Julia folks use to claim that their “parse integers” test shows Julia faster than Fortran:

```fortran
    call system_clock(t1)
    do k2 = 1, NRUNS
        do k = 1, 1000
            call random_number(s1)
            n = int(s1*huge(n))
            call hex_string(n,s)
            m = parse_int(s(:len_trim(s)), 16)
            call assert(m == n)
        end do
    end do
    call system_clock(t2)

```

---

_[View the full topic](https://fortran-lang.discourse.group/t/improving-fortran-results-in-the-julia-micro-benchmarks/198)._
