# Benchmark for latest julia?

**URL:** <https://discourse.julialang.org/t/benchmark-for-latest-julia/5991>\
**Category:** Community\
**Tags:** question\
**Created:** [September 20, 2017, 2:47am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991 "2017-09-20T02:47:24Z")\
**Posts on this page:** 20\
**Page:** 6

<div class="post-metadata">

**Author:** ![anon67531922](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Post date:** [June 23, 2018, 5:16am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/101 "2018-06-23T05:16:18Z")

</div>

Please add Excel to the benchmarks 😂

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [June 23, 2018, 5:50am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/102 "2018-06-23T05:50:20Z")

</div>

btw, the [MicroBenchmarks](https://github.com/JuliaLang/Microbenchmarks) package mentions languages such as Rust, Scala and Stata yet these results don’t seem to be shown anywhere (and I wasn’t able to find them?)

---

<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:** [June 23, 2018, 4:55pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/103 "2018-06-23T16:55:59Z")

</div>

> [@ScottPJones](#):
>
> Too bad he can’t be dragged into the Julia community!

Exactly what I [wrote previously](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/64).

I also thought about importing his ideas.  
Yet @StefanKarpinski [wrote that this can’t be done as LuaJit and Julia are inherently different](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/66).

We can still cross fingers :-).

---

<div class="post-metadata">

**Author:** ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)\
**Post date:** [June 23, 2018, 5:01pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/104 "2018-06-23T17:01:00Z")

</div>

MATLAB in academia is about 500€ for a single license, I think, for a first time buy, and 20% in annual upgrade cost. Toolboxes are about 300€ for a single license. OK – this is what it used to be some years ago.

Student licenses are ca. 50-60€ or so, I think.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 23, 2018, 7:21pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/105 "2018-06-23T19:21:06Z")

</div>

I never said he should be dragged into the Julia community to redo the ideas he had in the _past_.  
Somebody that smart I’m sure could have a whole bunch of new ideas, relevant to Julia, once he got his feet wet  
(and might love a chance to start on something new - I know I felt like a kid in a candy store when I discovered Julia, but I didn’t want to just recreate what I’d done in the past, but explore new things that I hadn’t been able to before, because I was held back by all of the legacy decisions made before my time, and the tools (C/C++/asm) I had available at the time)

---

<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:** [June 23, 2018, 7:42pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/106 "2018-06-23T19:42:24Z")

</div>

Well,

I meant that too.  
Brilliant people as Julia creators and Mike Pall are welcome in any project.

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [June 23, 2018, 7:48pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/107 "2018-06-23T19:48:18Z")

</div>

Yes, it was more Stefan’s comment that I was referring to - just because somebody has been around for a while, and has some expertise outside of university and Julia, doesn’t meant that they can’t come up with new tricks! 😀  
(Tim Holy for example, is no spring chicken, but he’s done a ton for Julia, IMO!)

---

<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:** [June 24, 2018, 2:30am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/108 "2018-06-24T02:30:07Z")

</div>

> [@tlienart](#):
>
> btw, the [MicroBenchmarks](https://github.com/JuliaLang/Microbenchmarks) package mentions languages such as Rust, Scala and Stata yet these results don’t seem to be shown anywhere (and I wasn’t able to find them?)

The Rust microbenchmarks are running again, thanks to some great work by Enet4 (github handle). If I remember correctly Rust is competitive with C, Julia, and SciLua on the microbenchmarks. But I’m waiting for julia-0.7.0 to drop before submitting the next set of benchmark updates to [julialang.org](http://julialang.org).

Microbenchmark results for Scala and Stata are missing because I haven’t gotten these languages running on my reference machine, a Linux box running opensuse leap 15.

---

<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:** [June 24, 2018, 8:43am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/109 "2018-06-24T08:43:57Z")

</div>

@John_Gibson,

Could we add more simple Micro Benchmarks?  
Something like bisection method to find a root of a simple function, solving simple question with Dynamic Programming?

I can write them in MATLAB.

---

<div class="post-metadata">

**Author:** ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)\
**Post date:** [June 24, 2018, 11:38am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/110 "2018-06-24T11:38:24Z")

</div>

I think a nice overall performance micro benchmark **of language** performance is the non-recursive Heaps algorithm which generates all permutations of given length. The non-allocating (to avoid measuring perf of `malloc`) version in Julia:

```julia
function heaps(N)
    elts = collect(1:N)
    c = ones(Int, N)
# print(elts)
    n = 1
    k = 0
    count = 1
    while n <= length(elts)
      if c[n] < n
         k = ifelse(isodd(n), 1, c[n])
         elts[k], elts[n] = elts[n], elts[k]
         c[n] += 1
         n = 1
         count += 1
# print(elts)
      else
        c[n] = 1
        n += 1
      end
   end
   return count
end

```

---

<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:** [June 24, 2018, 1:48pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/111 "2018-06-24T13:48:37Z")

</div>

All good suggestions. All need implementations in many languages to be useful cross-language benchmarks.

---

<div class="post-metadata">

**Author:** ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)\
**Post date:** [June 24, 2018, 4:55pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/112 "2018-06-24T16:55:49Z")

</div>

here You have it, in C:

```nohighlight
void swap(int *p, int a, int b){
   int tmp;
   tmp = p[a];
   p[a] = p[b];
   p[b] = tmp;
}

void pprint(int l, int *p){
   int i;
   for (i = 0; i < l; i++){
      printf("%d ", p[i]);
   }
   printf("\n");
}

long heaps(int N){
   long count = 0;
   int n;

   int *p = malloc(sizeof(int)*N);
   int *c = calloc(N, sizeof(int));

   for (n=0; n < N; n++){
      p[n] = n+1;
   }

   // pprint(N, p);
   count += p[1];

   for (n=0; n < N;){
      if (c[n] < n){
         swap(p, (n%2 ? c[n] : 0), n);

         count += p[1];
         // pprint(N, p);

         c[n]++;
         n = 0;
      } else {
         c[n] = 0;
         n++;
      }
   }
   free(p);
   free(c);
   return count;
}

```

---

<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:** [June 24, 2018, 5:17pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/113 "2018-06-24T17:17:11Z")

</div>

> [@abulak](#):
>
> here You have it, in C:

There’s 10 other languages left. And don’t put it here, just PR it to: [GitHub - JuliaLang/Microbenchmarks: Microbenchmarks comparing the Julia Programming language with other languages](https://github.com/JuliaLang/Microbenchmarks)

---

<div class="post-metadata">

**Author:** ![Vishakh](https://avatars.discourse-cdn.com/v4/letter/v/c89c15/32.png) [@Vishakh](https://discourse.julialang.org/u/Vishakh)\
**Post date:** [September 19, 2018, 5:45pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/114 "2018-09-19T17:45:46Z")

</div>

Can you explain the y axis of this benchmarking chart. which values are being used to plot the graph

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [September 19, 2018, 6:21pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/115 "2018-09-19T18:21:59Z")

</div>

that is time, in log scale, compare to C efficiency having unity time.

---

<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:** [September 19, 2018, 6:24pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/116 "2018-09-19T18:24:25Z")

</div>

The y axis is the execution time of each algorithm in each language, normalized so that the execution time of each algorithm in C is 1.0.

This used to be described somewhere on the benchmarks page, but it appears we dropped it during a reorganization of the website for 1.0. Thanks, I’ll make sure it gets back in.

---

<div class="post-metadata">

**Author:** ![aalexandersson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aalexandersson/32/2927_2.png) [@aalexandersson](https://discourse.julialang.org/u/aalexandersson)\
**Post date:** [September 19, 2018, 9:02pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/117 "2018-09-19T21:02:11Z")

</div>

I am familiar with Stata for Linux though I have not used your distro: What is the error message, if any? Have you contacted Stata Tech Support? Statalist? Are you trying to install the latest version 15 or an older version?

> [@John\_Gibson](#):
>
> Microbenchmark results for Scala and Stata are missing because I haven’t gotten these languages running on my reference machine, a Linux box running opensuse leap 15.

---

<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:** [September 19, 2018, 9:49pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/118 "2018-09-19T21:49:16Z")

</div>

TBH, the chart is very unreadable with using just hardly distinguishable colors that are overlapping in such a way that one sees a maximum of 6 circles out of 8 for several languages, like Julia, Luajit, and Fortran. The chart could’ve been much readable if different markers were used. Here is a very rough example which shows a more-readable version of the benchmark (the original svg is awesome but I can’t upload it here):

 ![Benchmarks](https://global.discourse-cdn.com/julialang/original/3X/2/d/2ddfbb0f04d62792462dc9f043023164fd50ae31.jpeg)

---

<div class="post-metadata">

**Author:** ![ScottPJones](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/scottpjones/32/146_2.png) [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Post date:** [September 20, 2018, 11:56am UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/119 "2018-09-20T11:56:24Z")

</div>

The label for Lua should be changed to LuaJIT, it would be interesting (at least to me) to see what the results for Lua (the interpreter, and standard for the language, LuaJIT is not 100% compatible from what I’ve heard) are also.  
I think it’s more useful also to order the language by (at least approximately) relative performance, to make it easier to compare the results of C++, Rust, Julia, LuaJIT, and Go, for example, where the results are very close.

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [September 20, 2018, 1:45pm UTC](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991/120 "2018-09-20T13:45:07Z")

</div>

> [@Seif\_Shebl](#):
>
> The chart could’ve been much readable if different markers were used.

It’s not written in stone and the code to generate it is open source. If you think it can be improved, please do so!

[Previous page](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991.md?page=5)

[Next page](https://discourse.julialang.org/t/benchmark-for-latest-julia/5991.md?page=7)
