bugGNU Octave - Bugs: bug #52206, semilogy speed

 
 

bug #52206: semilogy speed

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

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 02 Apr 2019 08:42:34 PM UTC, comment #7: 

No response, assuming this has been fixed in 5.1.0.  Closing report.

Rik <rik5>
Group administrator
Tue 26 Mar 2019 09:20:52 PM UTC, comment #6: 

Version 4.2.1 is deprecated and no longer supported.  Please try with the latest stable release which is 5.1.0.  The problem is likely to have been fixed.

Rik <rik5>
Group administrator
Mon 23 Oct 2017 09:30:29 AM UTC, comment #5: 

Command
    fc-match "Helvetica"
returns
    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

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.:


set(0, 'DefaultAxesFontName', 'Roboto')
set(0, 'DefaultTextFontName', 'Roboto')


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.

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

Petr,

What does
fc-match "Helvetica"

returns on your system?

Dmitri.
--


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
close(4)

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

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:


dev (10/14/17)
--------
1.03474
1.05848
1.01782
1.04327
1.0456

1.039982

4.2.1
--------
1.12861
0.958021
1.19349
1.0854
0.974049
0.982637

1.05370116666667

4.0.3
--------
0.356216
0.225084
0.25301
0.216632
0.273527
0.222959

0.257904666666667

3.8.2
--------
0.457998
0.321754
0.309644
0.31255
0.31504
0.317864
0.300681

0.333647285714286





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

Hello,

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:


n=100;
x=(1:n)';
y=1+10*rand(n,4);
tic
for k=1:10
    semilogy(x,y)
end
toc


the execution times are:


Octave 2.1.73   0.014 sec
Octave 3.6.4    0.68  sec
Octave 4.0.3    0.15  sec
Octave 4.2.1    6     sec
Octave 4.3.0+   0.84  sec


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


Octave 2.1.73   0.014 sec
Octave 3.6.4    0.68  sec
Octave 4.0.3    0.15  sec
Octave 4.2.1    0.26  sec
Octave 4.3.0+   0.65  sec


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?

Thanks.

Petr Mikulik <mikulik>

 

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

Attach Files:
   
   
Comment:
   

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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-04-02 rik5 Open/ClosedOpen Closed
    2019-03-26 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code