Pygmt running very slowly in my computer(anaconda in WSL on Win 10 )

Dear all,
I installed pygmt version 0.5.0 via conda in WSL on my Win 10 computer two days ago, but I found that pygmt running is very slowly. I used the example from [https://www.pygmt.org/dev/gallery/lines/linefronts.html], My pygmt running time is about 26 seconds, there is a significant slowdown in running time compared to the official time( 4.818 seconds) . and I changed the python code to bash code:

#!/bin/bash
x0=1
x1=4
y=20
gmt begin out png
gmt basemap -R0/10/0/20 -JX15c/15c -B+t"Line Fronts"
for frontstyle in  f1c/0.25c\
    f1c/0.25c+b \
    f1c/0.25c+c \
    f5c/1c+l+s45+o2.25c \
    f1c/0.4c+l \
    f1c/0.3c+l+b \
    f1c/0.4c+r+c \
    f1c/0.3c+l+t \
    f1c/0.4c+r+t+p1.5p,dodgerblue \
    f0.5c/0.3c+r+t+o0.3c+p \
    f0.5c/0.3c+r+t+o0.3c+p+i
do
y=$((y - 1))
gmt plot -W1.25p -S$frontstyle -Gred3 << EOF
$x0 $y
$x1 $y
EOF
echo $x1 $y $frontstyle |gmt text -F+fCourier-Bold+jML -D0.75c/0c
done
gmt end

the running time of bash code is about 2 seconds, It looks normal. So, I was wondering what’s causing the slowdown.

Are you using WSL or WSL2?

WSL in general is very slow.

@Andreas, I use WSL1, But when I ran other python programs uninclude PyGMT package, it didn’t lose any speed, and when I ran GMT in WSL1 directly there was no significant slowdown compared with normal Linux system.

Ok. I don’t have any python-specific experience.

You could try to upgrade to WSL2. From what (little) I’ve tried, it’s faster.