# Any benchmark of Julia v1.0 vs older versions

**URL:** <https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330>\
**Category:** Performance\
**Created:** [August 13, 2018, 12:07am UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330 "2018-08-13T00:07:24Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)\
**Post date:** [August 17, 2018, 10:13am UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/41 "2018-08-17T10:13:30Z")

</div>

> [@kristoffer.carlsson](#):
>
> > What Julia’s areas have more room for improvement in the near future?
> 
> Better multithreading model.

The whole parallelization, it would be nice to have hybrid-parallelization with threading and MPI style area decomposition such a way that InfiniBand is also supported. Same very user-friendly way as the normal julia experience at the moment.

---

<div class="post-metadata">

**Author:** ![John\_Gibson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/john_gibson/32/5321_2.png) [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Post date:** [August 17, 2018, 2:12pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/42 "2018-08-17T14:12:53Z")

</div>

Some new benchmark data with @kristoffer.carlsson’s fixes for int parsing and printing ( [#28661](https://github.com/JuliaLang/julia/pull/28661), [#28670](https://github.com/JuliaLang/julia/pull/28670))

| | 0.6.4 | 1.0.0 | 1.0.0-DEV |
| --- | --- | --- | --- |
| iteration\_pi\_sum | 27.37 | 27.66 | 27.68 |
| matrix\_multiply | 70.24 | 70.32 | 70.33 |
| matrix\_statistics | 8.513 | 7.323 | 7.30 |
| parse\_integers | 0.132 | 0.218 | 0.163 |
| print\_to\_file | 6.860 | 10.870 | 6.50 |
| recursion\_fibonacci | 0.0406 | 0.0302 | 0.0302 |
| recursion\_quicksort | 0.248 | 0.259 | 0.261 |
| userfunc\_mandelbrot | 0.0565 | 0.0527 | 0.0527 |
| relative to C | 1.097 | 1.168 | 1.057 |

The relative-to-C numbers are geometric means relative to C compiled with gcc-7.3.1, computed this week. In previously published benchmarks julia-0.6.2 was at 1.05 relative to C with gcc-4.8.3, so I think gcc must have improved between these versions.

At the risk of attaching too much meaning to it, I’m pleased to report that julia-1.0.0-DEV is now the fastest non-C language on the microbenchmark suite.

| language | geomean |
| --- | --- |
| C | 1.0 |
| Julia | 1.057 |
| LuaJIT | 1.091 |
| Rust | 1.099 |
| Go | 1.48 |
| Fortran | 1.67 |
| Java | 3.46 |
| JavaScript | 4.79 |
| Matlab | 9.56 |
| Mathematica | 14.62 |
| Python | 16.91 |
| R | 48.5 |
| Octave | 338.3 |

 ![benchmarks](https://global.discourse-cdn.com/julialang/original/3X/c/e/cecec93990bb74d7064cf21e80914ae052b6abd7.png)

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [August 17, 2018, 2:32pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/43 "2018-08-17T14:32:50Z")

</div>

Why this simple benchmark is so slow for Julia compared to GNU C++?

# Recursive Fibonacci Benchmark using top languages on Github

> **[GitHub - drujensen/fib: Performance Benchmark of top Github languages](https://github.com/drujensen/fib)**
>
> Performance Benchmark of top Github languages

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 17, 2018, 2:35pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/44 "2018-08-17T14:35:37Z")

</div>

It seems to include both startup and compilation time.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 17, 2018, 2:36pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/45 "2018-08-17T14:36:41Z")

</div>

> [@dpsanders](#):
>
> It seems to include both startup and compilation time.

Which is insignificant since the benchmark takes ~10s.

---

<div class="post-metadata">

**Author:** ![ExpandingMan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/expandingman/32/866_2.png) [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Post date:** [August 17, 2018, 2:40pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/46 "2018-08-17T14:40:35Z")

</div>

At this point I think I get more satisfaction out of Mathematica beating Python than Julia beating everything 😆.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [August 17, 2018, 2:41pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/47 "2018-08-17T14:41:32Z")

</div>

> [@Juan](#):
>
> Why this simple benchmark is so slow for Julia compared to GNU C++?

> NOTE: The GNU implementation is using a `constexpr` which optimizes the recursive call to a constant. It breaks the benchmark since it doesn’t perform the same tasks as the other languages. It demonstrates that all benchmarks will have some caviat. Without the `constexpr` , GNU C++ is on par with the clang version at 6.159s.

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 17, 2018, 2:52pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/48 "2018-08-17T14:52:26Z")

</div>

Running with `julia -O3` gets it down to around 9 secs on my machine, which would put it in the top 10. PR? EDIT: Julia 1.0

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [August 17, 2018, 2:56pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/49 "2018-08-17T14:56:15Z")

</div>

It would be interesting to also include the MKL version of Julia, at least two benchmarks will be improved, `matrix_multiply` and `matrix_statistics`. This is fair since Luajit and MATLAB use MKL, I’m not sure about the others.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 17, 2018, 3:02pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/50 "2018-08-17T15:02:05Z")

</div>

> [@Seif\_Shebl](#):
>
> It would be interesting to also include the MKL version of Julia, at least two benchmarks will be improved, `matrix_multiply` and `matrix_statistics` . This is fair since Luajit and MATLAB use MKL, I’m not sure about the others.

Matrix multiply won’t change much. It’s things like some factorizations (QR, SVD) where MKL makes a difference.

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [August 17, 2018, 4:19pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/51 "2018-08-17T16:19:10Z")

</div>

> [@ChrisRackauckas](#):
>
> Matrix multiply won’t change much. It’s things like some factorizations (QR, SVD) where MKL makes a difference.

I think, and numbers show, differently (The benchmark will be updated once JuliaPro 1.x.xxx MKL + JuliaPro 1.x.xxx OpenBLAS will be released, Currently I think it is Julia 0.5 vs. MATLAB R2016b):

[![](https://global.discourse-cdn.com/julialang/original/3X/0/5/051b1865615593bcefcaeb40e710236d5f371f87.png) ](https://raw.githubusercontent.com/RoyiAvital/MatlabJuliaMatrixOperationsBenchmark/master/Figures/Figure0003.png)

If you use MKL Direct Call things will get even better fro small matrices.  
Let’s not go through all that again but OpenBLAS is still not up there with MKL in most performance metrics.

@Seif_Shebl, Why do you think LuaJit uses MKL?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 17, 2018, 4:27pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/52 "2018-08-17T16:27:46Z")

</div>

You didn’t show any numbers, just Julia vs MATLAB. In actual benchmarks that actually test Julia OpenBLAS vs Julia MKL, they do not show a meaningful difference in matrix multiplication.

> <https://github.com/barche/julia-blas-benchmarks/blob/master/BenchmarkResults.ipynb>

If MATLAB is doing well there then it’s doing something more. And it’s not small matrices since even your benchmark shows Julia is doing fine on small matrices.

> [@RoyiAvital](#):
>
> Let’s not go through all that again but OpenBLAS is still not up there with MKL in most performance metrics.

No, let’s be specific about where the differences are. You show a difference between MATLAB and Julia. But benchmarks of Julia MKL vs Julia OpenBLAS do not show such differences. This is interesting and you shouldn’t just throw it off as “but MATLAB uses MKL, let’s go get MKL” because that is inconsistent with the benchmark results, unless there is something unexplained! IMO that is definitely something that needs to be pointed out and addressed.

It might have to do with build settings. Maybe @barche can chime in.

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [August 17, 2018, 4:49pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/53 "2018-08-17T16:49:04Z")

</div>

> [@ChrisRackauckas](#):
>
> And it’s not small matrices since even your benchmark shows Julia is doing fine on small matrices.

Driven by the advances in deep learning and computer vision, [Intel has lately worked on optimizing small matrix-matrix multiplication functions](https://insidehpc.com/2018/02/intel-mkl-compact-matrix-functions-attain-significant-speedups/). These functions rely on true SIMD matrix computations, and provide significant performance benefits compared to traditional techniques that exploit multithreading but rely on standard data formats. So, I think if we build Julia against the latest MKL versions, we can achieve significant gains over OpenBLAS even with tiny matrices.

Here is also this presentation on how to [Speed Up Small-Matrix Multiplication using New Intel® Math Kernel Library Capabilities](https://software.intel.com/en-us/videos/speed-up-small-matrix-multiplication-using-new-mkl-capabilities).

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 17, 2018, 4:55pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/54 "2018-08-17T16:55:10Z")

</div>

Yes I agree but that still doesn’t account for the performance difference with larger matrices.

---

<div class="post-metadata">

**Author:** ![saschatimme](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/saschatimme/32/10313_2.png) [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Post date:** [August 17, 2018, 4:59pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/55 "2018-08-17T16:59:11Z")

</div>

I am curious, do you know of similar opportunities to improve the speed of factorizations (LU, QE; SVD) of small matrices?

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [August 17, 2018, 5:02pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/56 "2018-08-17T17:02:29Z")

</div>

@ChrisRackauckas,  
Do you believe the difference between Julia + OpenBLAS to MATLAB + OpenBLAS is due to overhead?  
Because I believe both just do a regular BLAS call with minimal overhead.  
MATLAB doesn’t have special API to extract better performance from MKL.

Anyhow, Once version 1.x.xxx of JuliaPro will be available we’ll be able to check those numbers again.

I still think Julia should use the Direct Call API of MKL.  
It seems it will have great effect on small matrices to a point it will (Maybe) be faster the StaticArrays.

@Seif_Shebl, Could you tell why do you think LuaJit was using Intel MKL in the tests above?

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [August 17, 2018, 5:03pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/57 "2018-08-17T17:03:54Z")

</div>

> [@RoyiAvital](#):
>
> Do you believe the difference between Julia + OpenBLAS to MATLAB + OpenBLAS is due to overhead?

No. For large matrices the cost of the multiply is so much larger than the overhead that it wouldn’t even register there. And you both show that there’s no difference for small matrices which is where overhead would be seen. There is something deeper going on.

As I said, I would check to see if it’s due to how it’s built. Instead of using JuliaPro MKL, build Julia with MKL yourself and see if that makes a difference. Then play with build flags.

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [August 17, 2018, 5:11pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/58 "2018-08-17T17:11:07Z")

</div>

If I understand it correctly, the test comparing Matlab with Julia for matrix multiplication shown by @RoyiAvital is a bit dated. Wouldn’t it be wise to get current numbers before jumping to conclusions?

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [August 17, 2018, 5:16pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/59 "2018-08-17T17:16:03Z")

</div>

> [@ChrisRackauckas](#):
>
> As I said, I would check to see if it’s due to how it’s built. Instead of using JuliaPro MKL, build Julia with MKL yourself and see if that makes a difference. Then play with build flags.

I rather not build stuff my self unless it is a code I created (I’m not very good at this unfortunately).  
Searching for other comparisons of MKL vs. OpenBLAS on R and Numpy they all show (Though most of them are ~2 years old, yet the numbers you brought are 2 yeas old as well) MKL is faster.

Few more weeks and we’ll have a clearer picture (JuliaPro MKL vs. JuliaPro OpenBLAS vs. MATLAB R2018a / R2018b).  
If we’ll see Julia with MKL on pure BLAS calls is much slower than MATLAB it means something isn’t right.

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [August 17, 2018, 5:18pm UTC](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330/60 "2018-08-17T17:18:06Z")

</div>

From the link above:

The latest version of Intel MKL adds six compact functions:

1. General matrix-matrix multiply
2. Triangular matrix equation solve
3. LU factorization (without pivoting)
4. Inverse calculation (from LU without pivoting)
5. Cholesky factorization
6. QR factorization

[Previous page](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330.md?page=2)

[Next page](https://discourse.julialang.org/t/any-benchmark-of-julia-v1-0-vs-older-versions/13330.md?page=4)
