Donate to Remove ads

Got a credit card? use our Credit Card & Finance Calculators

Thanks to Wasron,jfgw,Rhyd6,eyeball08,Wondergirly, for Donating to support the site

Mint 20 gnuplot very slow

Seek assistance with all types of tech. - computer, phone, TV, heating controls etc.
cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Mint 20 gnuplot very slow

#360594

Postby cinelli » November 27th, 2020, 12:27 pm

Can anyone help, please? I am running linux Mint 20 Cinnamon and I have a bash script which plots graphs using gnuplot. It was taking much too long and I have distilled the problem to a tiny script which plots just 3 points. The transcript is as follows:

temp@asus-mint$ ls -l zz*
-rwxrwxr-x 1 temp temp 73 Nov 27 11:52 zz
-rw-r--r-- 1 temp temp 12 Nov 27 11:53 zz.dat
temp@asus-mint$ cat zz
#!/bin/bash
gnuplot << END
! date
plot "zz.dat" w l
! sleep 2
q
END
date
temp@asus-mint$ cat zz.dat
1 1
2 2
3 3
temp@asus-mint$ time ./zz
Fri 27 Nov 11:53:37 GMT 2020
qt5ct: using qt5ct plugin
Fri 27 Nov 11:54:04 GMT 2020

real 0m27.364s
user 0m0.031s
sys 0m0.023s
temp@asus-mint$ exit

The script plots the graph, displays it for 2 seconds, then quits. But all this takes over 27 seconds whereas it should take a little over 2. All is fine in Mint 18 and Mint 19. What's more the script runs quickly in linux Mint 20 live. Is there anything I can do to find out what is going on in those first 25 seconds? Any ideas what is taking so long? Thanks.

Cinelli

Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10032 times

Re: Mint 20 gnuplot very slow

#360596

Postby Itsallaguess » November 27th, 2020, 12:32 pm

cinelli wrote:
Is there anything I can do to find out what is going on in those first 25 seconds?

Any ideas what is taking so long?


I'm sorry that I can't help with the specific issue that's slowing down the script in Mint 20 Cinnamon, but isn't the usual process with these types of issues to output some sort of run-time text at various points in the whole process, with accompanying system-time entries alongside them, and then inspect that timed text-script output after it's run?

You should then see which particular command or group of commands is causing the long slow-down that you're not seeing in other flavours of Mint...

Cheers,

Itsallaguess

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Mint 20 gnuplot very slow

#360598

Postby cinelli » November 27th, 2020, 12:43 pm

Yes, but I don't know of a way of getting debugging information from gnuplot, which is a linux utility.

Cinelli

JohnB
Lemon Quarter
Posts: 2509
Joined: January 15th, 2017, 9:20 am
Has thanked: 696 times
Been thanked: 1008 times

Re: Mint 20 gnuplot very slow

#360601

Postby JohnB » November 27th, 2020, 12:48 pm

time ./zzz
Fri 27 Nov 12:47:30 GMT 2020
qt5ct: using qt5ct plugin

real 0m2.609s
user 0m0.040s
sys 0m0.021s

and that time was me reacting to the instant display of the plot on screen

Mint 20 MATE

gnuplot -V
gnuplot 5.2 patchlevel 8

Itsallaguess
Lemon Half
Posts: 9129
Joined: November 4th, 2016, 1:16 pm
Has thanked: 4140 times
Been thanked: 10032 times

Re: Mint 20 gnuplot very slow

#360603

Postby Itsallaguess » November 27th, 2020, 12:52 pm

cinelli wrote:
Yes, but I don't know of a way of getting debugging information from gnuplot, which is a linux utility.


In that case then I'm not going to be too much help then, sorry - I've not used Mint in anger for some time now.

With it outputting graphics, if it's running in Software Rendering Mode and you're not specifically wanting or needing it to, then that might account for some of the slowdown, but I only mention that in passing in case it's relevant.

Cheers,

Itsallaguess

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Mint 20 gnuplot very slow

#360608

Postby cinelli » November 27th, 2020, 1:01 pm

JohnB wrote:Mint 20 MATE

gnuplot -V
gnuplot 5.2 patchlevel 8

Yes, that's the same version I am using in Cinnamon.

Cinelli

swill453
Lemon Half
Posts: 7991
Joined: November 4th, 2016, 6:11 pm
Has thanked: 991 times
Been thanked: 3659 times

Re: Mint 20 gnuplot very slow

#360611

Postby swill453 » November 27th, 2020, 1:12 pm

cinelli wrote:
real	0m27.364s
user 0m0.031s
sys 0m0.023s


As I'm sure you're aware, that means it used negligible CPU time in either user space or kernel space, plus a delay (effectively a sleep) of just over 27 seconds.

Subtracting your explicit sleep of 2 seconds, means that something is sleeping for 25 seconds, which is a suspiciously round number. Any new default delays built into the plotting software?

Scott.

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Mint 20 gnuplot very slow

#360816

Postby cinelli » November 28th, 2020, 10:44 am

Just to say that I get exactly the same effect if I actually type in the gnuplot, plot, etc commands. I put it all into a script only so that I could demonstrate how long it was all taking with the time command. I still find it odd that all runs quickly within live Mint, where the version of gnuplot is the same.

Cinelli

hiriskpaul
Lemon Quarter
Posts: 3931
Joined: November 4th, 2016, 1:04 pm
Has thanked: 706 times
Been thanked: 1567 times

Re: Mint 20 gnuplot very slow

#360835

Postby hiriskpaul » November 28th, 2020, 11:17 am

On Unix I used to use something called truss to trace system calls. On Linux strace appears to provide something similar. You could try running gnuplot from strace on both systems. Differences may give some clue as to the issue.

JohnB
Lemon Quarter
Posts: 2509
Joined: January 15th, 2017, 9:20 am
Has thanked: 696 times
Been thanked: 1008 times

Re: Mint 20 gnuplot very slow

#360855

Postby JohnB » November 28th, 2020, 12:12 pm

If it helps the OP, my strace is at http://files.johnbray.org.uk/zzz.txt

xeny
Lemon Slice
Posts: 450
Joined: April 13th, 2017, 11:37 am
Has thanked: 235 times
Been thanked: 154 times

Re: Mint 20 gnuplot very slow

#360999

Postby xeny » November 28th, 2020, 7:42 pm

cinelli wrote:Just to say that I get exactly the same effect if I actually type in the gnuplot, plot, etc commands. I put it all into a script only so that I could demonstrate how long it was all taking with the time command. I still find it odd that all runs quickly within live Mint, where the version of gnuplot is the same.

Cinelli


Do you get the same delay if you run the script as a different user? That 25 second delay looks like a config problem somewhere and it would isolate if it is the OS install or your account.

Is there any CPU load in top during those 25 seconds?

swill453
Lemon Half
Posts: 7991
Joined: November 4th, 2016, 6:11 pm
Has thanked: 991 times
Been thanked: 3659 times

Re: Mint 20 gnuplot very slow

#361011

Postby swill453 » November 28th, 2020, 8:54 pm

xeny wrote:Is there any CPU load in top during those 25 seconds?

Unlikely, that would show up in either user or sys values in the "time" output.

Scott.

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Mint 20 gnuplot very slow

#362539

Postby cinelli » December 3rd, 2020, 11:24 am

I have made some progress on this problem. If you remember I was getting a delay of about 27 seconds when plotting a trivial graph in gnuplot. But to some extent gnuplot is a red herring. I get a similar delay, but not consistently, in vlc from the command line. The common feature is the line “qt5ct: using qt5ct plugin”. This occurs just as a display window is created. Qt has a controlling configuration file at ~/.config/qt5ct/qt5ct.conf and by renaming or deleting this file, the delay to gnuplot vanishes. Without the config file I can see no change in the gnuplot window but you do notice a different font in vlc. So that is the workaround but that doesn’t explain why there is a delay. Running gnuplot with strace in place (thank you hiriskpaul for this tip) displays the line “clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=200000000}, NULL) = 0” at the point of the delay. But I find the manual page for clock_nanosleep difficult. Also I can find little information on the contents of the config file qt5ct.conf.
An alternative workaround for gnuplot is not to accept the default window type, qt, for the plot. “Set term x11” works without the need to delete or rename qt5ct.conf.
Unexplained are the following points:
I get no delay in linux Mint 19 cinnamon even though the qt config file is identical.
I get no delay in linux Mint 20 live even though this temporary account too has the identical config file.

Cinelli

servodude
Lemon Half
Posts: 8412
Joined: November 8th, 2016, 5:56 am
Has thanked: 4490 times
Been thanked: 3621 times

Re: Mint 20 gnuplot very slow

#362740

Postby servodude » December 3rd, 2020, 10:28 pm

cinelli wrote:I have made some progress on this problem. If you remember I was getting a delay of about 27 seconds when plotting a trivial graph in gnuplot. But to some extent gnuplot is a red herring. I get a similar delay, but not consistently, in vlc from the command line. The common feature is the line “qt5ct: using qt5ct plugin”. This occurs just as a display window is created. Qt has a controlling configuration file at ~/.config/qt5ct/qt5ct.conf and by renaming or deleting this file, the delay to gnuplot vanishes. Without the config file I can see no change in the gnuplot window but you do notice a different font in vlc. So that is the workaround but that doesn’t explain why there is a delay. Running gnuplot with strace in place (thank you hiriskpaul for this tip) displays the line “clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=200000000}, NULL) = 0” at the point of the delay. But I find the manual page for clock_nanosleep difficult. Also I can find little information on the contents of the config file qt5ct.conf.
An alternative workaround for gnuplot is not to accept the default window type, qt, for the plot. “Set term x11” works without the need to delete or rename qt5ct.conf.
Unexplained are the following points:
I get no delay in linux Mint 19 cinnamon even though the qt config file is identical.
I get no delay in linux Mint 20 live even though this temporary account too has the identical config file.

Cinelli


OK so it sounds like something up with the qt config
- possibly a dangling reference that it eventually gives up on (or possibly permissions)

you could try running qtconfig to see if there are any indications of things amiss
- or a remove and reinstall of qt5-default via apt-get will take a few seconds

- sd

cinelli
Lemon Slice
Posts: 553
Joined: November 9th, 2016, 11:33 am
Has thanked: 234 times
Been thanked: 161 times

Re: Mint 20 gnuplot very slow

#363523

Postby cinelli » December 6th, 2020, 5:19 pm

servodude wrote:you could try running qtconfig to see if there are any indications of things amiss
- or a remove and reinstall of qt5-default via apt-get will take a few seconds

- sd

Thanks for these tips. It has made no difference however. Oh well ...

Cinelli

kyu66
2 Lemon pips
Posts: 249
Joined: November 14th, 2016, 5:14 pm
Has thanked: 2 times
Been thanked: 132 times

Re: Mint 20 gnuplot very slow

#363547

Postby kyu66 » December 6th, 2020, 6:17 pm

cinelli wrote:I have made some progress on this problem. If you remember I was getting a delay of about 27 seconds when plotting a trivial graph in gnuplot. But to some extent gnuplot is a red herring. I get a similar delay, but not consistently, in vlc from the command line. The common feature is the line “qt5ct: using qt5ct plugin”. This occurs just as a display window is created. Qt has a controlling configuration file at ~/.config/qt5ct/qt5ct.conf and by renaming or deleting this file, the delay to gnuplot vanishes. Without the config file I can see no change in the gnuplot window but you do notice a different font in vlc. So that is the workaround but that doesn’t explain why there is a delay. Running gnuplot with strace in place (thank you hiriskpaul for this tip) displays the line “clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=0, tv_nsec=200000000}, NULL) = 0” at the point of the delay. But I find the manual page for clock_nanosleep difficult. Also I can find little information on the contents of the config file qt5ct.conf.
An alternative workaround for gnuplot is not to accept the default window type, qt, for the plot. “Set term x11” works without the need to delete or rename qt5ct.conf.
Unexplained are the following points:
I get no delay in linux Mint 19 cinnamon even though the qt config file is identical.
I get no delay in linux Mint 20 live even though this temporary account too has the identical config file.

Cinelli

Ubuntu rather than Mint but does this help? It sounds like the same issue you are having.

https://askubuntu.com/questions/1233429 ... tformtheme


Return to “Technology - Computers, TV, Phones etc.”

Who is online

Users browsing this forum: No registered users and 28 guests