bugGNU Octave - Bugs: bug #52206, semilogy speed


bug #52206: semilogy speed

Submitted by:  Petr Mikulik <mikulik>
Submitted on:  Wed 11 Oct 2017 08:50:51 AM UTC  
Category:  Plotting Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  4.2.1 Operating System:  GNU/Linux

Add a New Comment(Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Mon 23 Oct 2017 09:30:29 AM UTC, comment #5:

fc-match "Helvetica"
texgyreheros-regular.otf: "TeX Gyre Heros" "Regular"

I don't have any "set(...)" commands in my startup, neither in /etc/octave/octaverc. I have also created a new user, and timings are same as in my account, so I don't have any forgotten settings.

Why the font would be the cause? Because of the upper index in tics and its rescaling?


Petr Mikulik <mikulik>
Fri 20 Oct 2017 04:26:34 AM UTC, comment #4:

I can get benchmark time to increase from ~1 sec to > 3 sec
if I set specific fonts e.g.:

Or just "Sans" -- there are some variations
depending on the paticular font, but the time is always
longer if I leave the "se(..)" out.

Even If I set to "Helvetica" or to "Arimo" (this is what
I get for Helvetica on my machine) it is still longer.
(For "Helvetica" I get ~4sec with the recen dev version,
2.1 with 4.2.1).
With the default settings i get 0.9 sec with dev version and 1.6 with 4.2.1


Dmitri A. Sergatskov <dasergatskov>
Fri 20 Oct 2017 04:07:19 AM UTC, comment #3:


What does
fc-match "Helvetica"

returns on your system?


Dmitri A. Sergatskov <dasergatskov>
Thu 19 Oct 2017 12:40:46 PM UTC, comment #2:

Hello Rik,

I have updated the table with timings 4.2.1 vs 4.0.3 on various computers. The slow-down is found on all machines, but it is mostly pronounced on the two OpenSUSE computers.

(Times are averaged over several measurements rounded to two valid digits.)

32 bit, Ubuntu 16.04, gcc 5.4
4.0 1.1 sec
4.2.1 4.1 sec => cca 4 times

64 bit, Debian 8, gcc 4.9.2
4.0.3 0.30 sec
4.2.1 1.2 sec => cca 4 times

64 bit desktop, OpenSUSE 42.2, gcc 4.8.5
4.0.3 0.15 sec
4.2.1 6.1 sec => cca 40 times
hg 0.83 sec

64 bit notebook, OpenSUSE 42.2, gcc 4.8.5
2.1.73 0.70 sec
3.6.4 2.1 sec
4.0.3 0.53 sec
4.2.1 15 sec => cca 28 times

I tried to remove $HOME/octave, $HOME/.octaverc, but it did not change anything.


Then I run Octave via
strace octave-cli test.m 2>log

Comparing the above logs for 4.0.3 and 4.2.1 I can see that 4.2.1 is doing stat("") such as
stat("/opt/octave/octave-4.2.1/ ...")
on every file for all files in /opt/octave/octave-4.2.1/ while 4.0.3 is not doing that.


Further, the log shows that 4.2.1 is 571 times trying to access one font as:

open("/usr/share/fonts/truetype/Roboto-Regular.ttf", O_RDONLY) = 4
fcntl(4, F_SETFD, FD_CLOEXEC) = 0
fstat(4, {st_mode=S_IFREG|0644, st_size=515100, ...}) = 0
mmap(NULL, 515100, PROT_READ, MAP_PRIVATE, 4, 0) = 0x7f447e973000

This font is tried to be open for both gnuplot and qt graphic backends.
This font file exists in /usr/share/fonts/truetype/Roboto-Regular.ttf.
I don't see any place in .octaverc or .config/octave where this font is mentioned.


Can the two above things be the problem?


Petr Mikulik <mikulik>
Sat 14 Oct 2017 10:06:52 PM UTC, comment #1:

I placed your test code in an m-file and then ran it multiple times for several different versions. I certainly see a slowdown from 4.0.3 to 4.2.1, but it is not the 40X that you are seeing. Maybe you could run the benchmark again several times with 4.2.1 to see if the 6 seconds was an outlier. My results:

Rik <rik5>
Project Administrator
Wed 11 Oct 2017 08:50:51 AM UTC, original submission:


well, this is either a performance regression or a bug.

Using a graphical update during a simulation, I have found a major slow-down of the "semilogy" plot in Octave 4.2.1 compared to other Octave versions (40 times compared to 4.0.3).

For this test code:

the execution times are:

Using plot(x,log10(y)) instead of semilogy() gives

Execution times are similar for all 3 backends.
Gnuplot itself does a similar plot in 0.01 sec.

Can you please fix it for Octave 4.2.2?

Why the performance dropped so much from 4.0.3 (4x for plot, 6x for semilogy)?

The above test further shows slow down of plot() in Octave 4.3.0+ .

Can the the plotting be improved?


Petr Mikulik <mikulik>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by mikulik (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.3