# Julia faster on Mac OSX than in linux?

**URL:** https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839
**Category:** New to Julia
**Created:** [March 20, 2018, 4:00pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839 "2018-03-20T16:00:12Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [March 20, 2018, 4:00pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/1 "2018-03-20T16:00:12Z")

</div>

I use julia for my research. My lab has both iMac (i5@2.7GHz,8GB,High Seirra) and Hp Desktop machine (i7@3.6GHz,16GB, with elementaryOS). I ran a speed test using `peakflops()` in both the machines and the results are below

```julia
# For Linux desktop
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Prescott)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

julia> peakflops()
3.588384754696235e10

julia> peakflops()
3.393129118818704e10

julia> peakflops(parallel=true)
3.667023267872277e10

julia> peakflops(parallel=true)
3.668789077963552e10

```

```julia
# For iMac
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin14.5.0)
  CPU: Intel(R) Core(TM) i5-4570R CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

julia> peakflops()
1.3308120765839432e11

julia> peakflops()
9.118221999595766e10

julia> peakflops(parallel=true)
1.1292449978046065e11

julia> peakflops(parallel=true)
1.2288056560449782e11

```

Even though the linux machine has a better hardware, the speed of julia in iMac is higher.  
Any comments?

---

<div class="post-metadata">

### Author: ![Balinus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/balinus/32/243_2.png) [@Balinus](https://discourse.julialang.org/u/Balinus)
#### Post date: [March 20, 2018, 4:16pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/2 "2018-03-20T16:16:05Z")

</div>

`peakflops()` seems rather unstable in terms of return values.

![peak_func](https://global.discourse-cdn.com/julialang/original/3X/2/8/288cea229b9c1c716967bf611744985fcbdd109d.png)

```julia
using Plots
function benchpeak()
    niter = 500
    T = fill(NaN, niter)
    for n = 1:niter
        T[n] = peakflops();
    end
    return T
end
T = benchpeak()
histogram(T)

```

In other words, try with more iterations to see if your results still holds.

---

<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: [March 20, 2018, 4:33pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/3 "2018-03-20T16:33:26Z")

</div>

Besides that, it almost has to be the case that `peakflops()` just calls some POSIX binding or something, doesn’t it? If that’s indeed the case than the return value doesn’t have anything to do with Julia in particular.

---

<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: [March 20, 2018, 5:05pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/4 "2018-03-20T17:05:24Z")

</div>

You are testing on two different computers, so it is not surprising that one may be more performant than another. Also, specs tell you little about the real life experience.

---

<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: [March 20, 2018, 5:57pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/5 "2018-03-20T17:57:13Z")

</div>

```julia
"""
    peakflops(n::Integer=2000; parallel::Bool=false)
`peakflops` computes the peak flop rate of the computer by using double precision
[`gemm!`](@ref LinearAlgebra.BLAS.gemm!). By default, if no arguments are specified, it
multiplies a matrix of size `n x n`, where `n = 2000`. If the underlying BLAS is using
multiple threads, higher flop rates are realized. The number of BLAS threads can be set with
[`BLAS.set_num_threads(n)`](@ref).
If the keyword argument `parallel` is set to `true`, `peakflops` is run in parallel on all
the worker processors. The flop rate of the entire parallel computer is returned. When
running in parallel, only 1 BLAS thread is used. The argument `n` still refers to the size
of the problem that is solved on each processor.
"""

```

---

<div class="post-metadata">

### Author: ![mpastell](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mpastell/32/350_2.png) [@mpastell](https://discourse.julialang.org/u/mpastell)
#### Post date: [March 20, 2018, 7:04pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/6 "2018-03-20T19:04:53Z")

</div>

Try using bigger `n` e.g. `peakflops(10_000)` , I get 1.6e11 on Linux with core i7-4770 and your processor should be a bit faster.

---

<div class="post-metadata">

### Author: ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)
#### Post date: [March 20, 2018, 8:39pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/7 "2018-03-20T20:39:20Z")

</div>

Seems like it has to warm up a little:

```julia
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  WORD_SIZE: 64
  BLAS: libmkl_rt
  LAPACK: libmkl_rt
  LIBM: libimf
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

julia> peakflops()
7.868601282943965e10

julia> peakflops()
1.1988692385229176e11

julia> peakflops(10_000)
2.057506433249601e11

julia> peakflops()
1.8486195064111972e11

```

edit: OpenBLAS:

```julia
julia> versioninfo()
Julia Version 0.6.2
Commit d386e40 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, haswell)

julia> peakflops()
1.5887918519922025e11

julia> peakflops(10_000)
1.6348315789326385e11

julia> peakflops()
1.6243814292065182e11

```

Your (v-i-s-h) CPU is newer than mine; I’d expect it to be faster.

---

<div class="post-metadata">

### Author: ![samoconnor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samoconnor/32/1802_2.png) [@samoconnor](https://discourse.julialang.org/u/samoconnor)
#### Post date: [March 20, 2018, 11:43pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/8 "2018-03-20T23:43:46Z")

</div>

> … one may be more performant than another …

A bit off topic:  
I’ve been seeing this word “performant” a bit recently. What is it intended to mean?  
Is it different to “one may be faster than another” ? or “one may be more efficient than another”?

---

<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: [March 21, 2018, 12:02am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/9 "2018-03-21T00:02:12Z")

</div>

> Adjective. performant (comparative more performant, superlative most performant) (jargon, chiefly computing) Capable of or characterized by an adequate or excellent level of performance or efficiency.

---

<div class="post-metadata">

### Author: ![samoconnor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samoconnor/32/1802_2.png) [@samoconnor](https://discourse.julialang.org/u/samoconnor)
#### Post date: [March 21, 2018, 12:18am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/10 "2018-03-21T00:18:14Z")

</div>

Interesting, thank’s for indulging my off-topic side track.

Is there some context where saying “more performant” is clearer than saying “more efficient” or “faster”? … or in the context above just “one may perform better than another”?

I sound like I remember my grandmother sounding when she used to pick on my grammar, I must be getting old 🙂

Sometimes it’s important to learn the new technical jargon. Sometimes the new technical jargon is only there to make things seem more magical and complex than they really are.

---

<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: [March 21, 2018, 12:21am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/11 "2018-03-21T00:21:42Z")

</div>

> [@samoconnor](#):
>
> Is there some context where saying “more performant” is clearer than saying “more efficient” or “faster”? … or in the context above just “one may perform better than another”?

Well, not that I can think of, and I’ve kind of caught the habit of using the term myself over the last few years! 😉

On second thought, one could say that something is more performant, if it uses fewer resources, to get the same result in a similar time, I think, and “faster” would not do, in that case - so maybe more of a combination of faster and/or efficient, maybe implying better scalability.

Jargon, in other words!

---

<div class="post-metadata">

### Author: ![pasha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pasha/32/3319_2.png) [@pasha](https://discourse.julialang.org/u/pasha)
#### Post date: [March 21, 2018, 12:25am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/12 "2018-03-21T00:25:44Z")

</div>

> [@samoconnor](#):
>
> Is there some context where saying “more performant” is clearer than…

I can’t think of an aspect of performance that people are referring to other than speed of execution. Allocations? Heat? DB access? Qubit flip rate? I don’t think they are being that precise. I expect it’s a plot to make old programmers look uneducated and out of touch.

---

<div class="post-metadata">

### Author: ![samoconnor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/samoconnor/32/1802_2.png) [@samoconnor](https://discourse.julialang.org/u/samoconnor)
#### Post date: [March 21, 2018, 12:33am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/13 "2018-03-21T00:33:04Z")

</div>

> Allocations? Heat? DB access? Qubit flip rate?

I can’t imagine any non-speed parameter that wouldn’t be covered by “efficient” (the relationship between the consumed things you care about and the produced things you care about).

---

<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: [March 21, 2018, 12:36am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/14 "2018-03-21T00:36:42Z")

</div>

Haha, being one of those old programmers myself!  
I think the real reason is simply the penchant in English for shortening things as much as possible,  
“isn’t performant” is shorter/faster (more performant? 😉 ) than saying “doesn’t perform very well”, and  
“is performant” than “performs adequately”.

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [March 21, 2018, 2:18am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/15 "2018-03-21T02:18:17Z")

</div>

(back on topic)

> [@v-i-s-h](#):
>
> CPU: Intel(R) Core™ i7-7700 CPU @ 3.60GHz  
> WORD\_SIZE: 64  
> BLAS: libopenblas (USE64BITINT DYNAMIC\_ARCH NO\_AFFINITY Prescott)

This probably means that OpenBLAS does not correctly identify your new processor, so it is not using the best SIMD instructions. (Prescott is the fallback architecture.)

You could build Julia to use MKL for BLAS, or you can try to force OpenBLAS to use the Haswell target. (See the README at [the main Julia repo](https://github.com/JuliaLang/julia) for instructions.)

---

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [March 21, 2018, 8:44am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/16 "2018-03-21T08:44:33Z")

</div>

May be Ralph’s comment is the key. [Julia faster on Mac OSX than in linux? - #15 by Ralph\_Smith](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/15). I should check this!

---

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [March 21, 2018, 8:45am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/17 "2018-03-21T08:45:00Z")

</div>

Yeah… I’ll check this.

---

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [March 21, 2018, 9:07am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/18 "2018-03-21T09:07:53Z")

</div>

I tried to install Julia Pro. My desktop is running elementaryOS. For those who are new to elementaryOS, it is derived from ubuntu and anything working in ubuntu should work in elementaryOS also. But I’m getting this error when trying to install:

```julia
vish@eliteone:~/Downloads$ ./JuliaPro-0.6.2.2_mkl_build-17.sh /opt/julialang/pro/
JuliaPro installation has started, please wait until all the files are extracted

OS Detected: elementary OS 0.4.1 Loki
Unsupported Linux Distribution: elementary

```

---

<div class="post-metadata">

### Author: ![v-i-s-h](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/v-i-s-h/32/46152_2.png) [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)
#### Post date: [March 22, 2018, 10:46am UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/19 "2018-03-22T10:46:25Z")

</div>

Thanks Ralph, This worked. After forcing to build openblas with HASWEL target, I have

```julia
vish@eliteone:/opt/julialang/src/julia$ ./julia 
               _
   _ _ _(_)_ | A fresh approach to technical computing
  (_) | (_) (_) | Documentation: https://docs.julialang.org
   _ _ _| |_ __ _ | Type "?help" for help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 0.6.2 (2017-12-13 18:08 UTC)
 _/ |\ __'_|_|_|\__'_| |  
|__/ | x86_64-linux-gnu

julia> versioninfo()
Julia Version 0.6.2
Commit d386e40* (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT NO_AFFINITY HASWELL)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

julia> peakflops()
1.7415419592915222e11

julia> peakflops()
1.2685746785691425e11

julia> peakflops()
1.9630557568812375e11

```

🙂

But now I’m more curious. Why official julia build went to Prescott arch?

---

<div class="post-metadata">

### Author: ![Ralph\_Smith](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ralph_smith/32/10344_2.png) [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)
#### Post date: [March 22, 2018, 1:11pm UTC](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839/20 "2018-03-22T13:11:40Z")

</div>

The OpenBLAS shipped with binary Julia distributions has a “dynamic” target which means that it picks an instruction set based on a runtime CPU check. Unfortunately the OpenBLAS team had not yet added checks for the newest models when the version used for Julia distribution was packaged. (I don’t know if this is corrected for your model in newer OpenBLAS.)

[Next page](https://discourse.julialang.org/t/julia-faster-on-mac-osx-than-in-linux/9839.md?page=2)
