# Simple benchmarks to run to test WSL2 vs Windows Native

**URL:** https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343
**Category:** Performance
**Created:** [May 28, 2020, 3:02pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343 "2020-05-28T15:02:45Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)
#### Post date: [May 28, 2020, 3:02pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/1 "2020-05-28T15:02:45Z")

</div>

I just upgraded to the new Windows May update which now has WSL 2 (a very lightweight, Hyper V VM running full Linux). I essentially now want to move all my development over to Linux. But I would like to test if there are any regressions in performance when running Julia on the VM compared with the native binary.

What are some of your favorite snippets of code to run benchmarks?

---

<div class="post-metadata">

### Author: ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)
#### Post date: [May 28, 2020, 4:31pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/2 "2020-05-28T16:31:18Z")

</div>

From the non Julia benchmarks I’ve seen, wsl2 sometimes performs on par with a regular Ubuntu install. So I understand it to be a big improvement over the first attempt.

The most relevant benchmarks are always your own programs, so I’d probably start there. Otherwise, you could run the benchmarks from the Julia homepage.

---

<div class="post-metadata">

### Author: ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)
#### Post date: [May 28, 2020, 4:38pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/3 "2020-05-28T16:38:22Z")

</div>

The general consensus is that the performance of WSL2 is on par with a native install (given the Type 1 hypervisor), but only if you stay within the VHD and the linux FS. As soon as you start reading/writing to `/mnt/c/` (i.e. to the Windows FS), things slow down tremendously

---

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [May 28, 2020, 5:00pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/4 "2020-05-28T17:00:59Z")

</div>

I would like to see these benchmarks (some or all, at least some multi-threaded too, i.e. where load is close to 100% on more than one of the four), but note it’s expected to get better numbers, e.g. I do roughly 2x on my Linux box (some programs there are faster with lower opt settings, I was meaning to point out, and NOT asking for threads):

> **[Julia vs Java - Which programs are fastest?](https://benchmarksgame-team.pages.debian.net/benchmarksgame/fastest/julia.html)**
>
> Julia Java - Which programs have fastest performance?

```julia
$ hyperfine '~/julia-1.6.0-DEV-8f512f3f6d/bin/julia -O0 --cpu-target=core2 --startup-file=no pidigits.jl 10000 >/dev/null'
Benchmark #1: ~/julia-1.6.0-DEV-8f512f3f6d/bin/julia -O0 --cpu-target=core2 --startup-file=no pidigits.jl 10000 >/dev/null
  Time (mean ± σ): 1.292 s ± 0.054 s [User: 1.669 s, System: 0.501 s]
  Range (min … max): 1.196 s … 1.366 s 10 runs

```

And please time “first-plot”, in another discourse thread, where I showed this recently, someone said this doesn’t work on Windows:

```julia
$ sudo apt-get install gnuplot

$ time ~/julia-1.5-ea669c3d3e/bin/julia -O1 --compile=min --startup-file=no -e "using Gaston; display(plot(rand(10)))"

real	0m0,691s # without display 0m0,400s, and also try other settings.
user	0m0,768s
sys	0m0,542s

```

> **[Comparing WSL Versions](https://learn.microsoft.com/en-us/windows/wsl/compare-versions)**
>
> WSL 2 provides the benefits of WSL 1, but uses an actual Linux kernel, rather than a translation layer like WSL 1, resulting in faster performance.

> File intensive operations like git clone, npm install, apt update, apt upgrade, and more are all be noticeably faster with WSL 2. […] WSL 2 run up to 20x faster compared to WSL 1

[https://www.reddit.com/r/bashonubuntuonwindows/comments/bn9pfi/difference\_between\_wsl2\_and\_bare\_bones\_virtual/](https://www.reddit.com/r/bashonubuntuonwindows/comments/bn9pfi/difference_between_wsl2_and_bare_bones_virtual/)

> WSL 2 is a virtual machine, but in their words “not like any VM you’ve seen before”. They utilize a very minimal HyperV toolset to run the Linux kernel.

I’m not sure how helpful this thread is or possibly outdated:  
[https://dev.to/lietux/comment/l6dl](https://dev.to/lietux/comment/l6dl)

---

<div class="post-metadata">

### Author: ![henry2004y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry2004y/32/9284_2.png) [@henry2004y](https://discourse.julialang.org/u/henry2004y)
#### Post date: [October 27, 2020, 4:58pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/5 "2020-10-27T16:58:14Z")

</div>

Did you install the Linux version of Julia? Do you know if it is possible to use the Windows version of Julia? What is the difference?

---

<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: [October 27, 2020, 5:55pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/6 "2020-10-27T17:55:13Z")

</div>

Here is one data point: [Comparison of Windows 10 and Linux Julia](https://discourse.julialang.org/t/comparison-of-windows-10-and-linux-julia/41227)

---

<div class="post-metadata">

### Author: ![henry2004y](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henry2004y/32/9284_2.png) [@henry2004y](https://discourse.julialang.org/u/henry2004y)
#### Post date: [October 29, 2020, 10:35pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/7 "2020-10-29T22:35:29Z")

</div>

Thanks for the useful performance info! For my own daily usage, Julia version installed on Ubuntu 20.04 WSL2 is totally fine, except that I probably have to make some extra effort to display plots. It was very confusing at first when I tried to install WSL2 because currently it is only available in the test version of Win10. I am still looking for an elegant way of plotting through WSL2.

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [October 29, 2020, 11:18pm UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/8 "2020-10-29T23:18:43Z")

</div>

> [@henry2004y](#):
>
> I am still looking for an elegant way of plotting through WSL2.

GMT.jl works fine in WSL. It has to since it mostly produces Postscript that is then converted (automatically or not) to other formats.

---

<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: [October 30, 2020, 12:43am UTC](https://discourse.julialang.org/t/simple-benchmarks-to-run-to-test-wsl2-vs-windows-native/40343/9 "2020-10-30T00:43:01Z")

</div>

Gnuplot.jl or Gaston.jl?
