bugGNU Octave - Bugs: bug #44703, 10X slowdown on Windows XP vs....

 
 

bug #44703: 10X slowdown on Windows XP vs. Linux

Submitter:  Rik <rik5>
Submitted:  Thu 02 Apr 2015 05:31:59 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Performance
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 10 Apr 2015 04:00:57 PM UTC, comment #9: 

Okay, it's good to know that this is just an artifact of the virtual machine rather than an actual problem.  Closing report.

Rik <rik5>
Group administrator
Fri 10 Apr 2015 03:46:10 PM UTC, comment #8: 

It seems that the Virtual Machine is the cause for
the time diferences.

I run 32 bit Octave on 64 bit Win7, and got:


>> tic; lintst; toc
100 / 100 passed
Elapsed time is 11.3169 seconds.


I have Linux (Ubuntu) on this computer, installed as VM


>> tic; lintst; toc
100 / 100 passed
Elapsed time is 73.9474 seconds.



Avinoam Kalma <avinoam>
Group Member
Mon 06 Apr 2015 09:08:02 AM UTC, comment #7: 

One thing I'd be wary of is that you run XP in a virtual machine.
I'd expect loads of overhead there esp. for user I/O stuff like terminal interaction, mouse/keyboard, etc., that all has to be captured and translated by the virtual machine SW.

Philip Nienhuis <philipnienhuis>
Group Member
Mon 06 Apr 2015 12:43:18 AM UTC, comment #6: 

I guess we just leave this alone until we have more data points.  All of your testing seems correct and I can't explain why Windows is 3X faster for you, but 10X slower for me.

Rik <rik5>
Group administrator
Sat 04 Apr 2015 09:37:06 PM UTC, comment #5: 

I'm also surprised, if not flabbergasted.
Note that years ago, Octave on Linux also ran slower than on Windows and both were slower than OS/2; I think OS/2 was twice as fast as Linux (AFAIU OS/2 in its time had a superior threading model).
But yes 3 X slower is, well, ridiculous :-) - esp. as I ran the GUIs on Windows and the CLI on Linux to avoid workspace pane updates.

I've built the Windows versions with MXE & OpenBLAS (cross-build; --enable-windows-64); the Linux one (64-bit indexing) also with MXE (native build) and (IIRC) OpenBLAS, with the configure options outlined by JWE in a bug report from some months ago:

https://savannah.gnu.org/bugs/index.php?43319, see comment #13 there.

I also tried a "regular" Linux build with the 32-bit indexing libs supplied by Mageia, without OpenBLAS; that had about the same execution time as the 64-bit indexing Octave. So that may be a clue that OpenBLAS wasn't invoked on Linux.

I'm not very sure I've also specified the --enable-openblas option, but OpenBLAS was built and in the .tgz, I figure just symlinking libblas.so to libopenblas.so would suffice?

Just to be sure, in the Windows version I copied librefblas.dll to libblas.dll and tried again:

>> tic; lintst; toc
100 / 100 passed
Elapsed time is 10.9646 seconds.
>>


...so it seems OpenBLAS or refBLAS don't make much difference.
There seems to be a lot of overhead elsewhere in Octave.

FWIW, my desktop system:
Gigabyte Z87-HD3 mobo, 8 GB RAM
Core i5-4570 3.2GHz
500 GB SSD
Windows 7 Prof. 64-bit  &  Mageia-4 Linux 64-bit

Philip Nienhuis <philipnienhuis>
Group Member
Sat 04 Apr 2015 04:03:54 PM UTC, comment #4: 

@Philip: It's strange to me that Linux is ~3X slower than Windows on the same hardware.  Are they Windows and Linux versions compiled with the same options?  Or was Windows from an executable installer and Linux from a compiler or distribution?

Rik <rik5>
Group administrator
Sat 04 Apr 2015 12:24:17 PM UTC, comment #3: 

I wouldn't care too much about Win XP.

FWIW, I see quite different results on my multiboot box (all OSes running on bare metal):

64-bit Octave on Win7 64-bit:
=====================
>> tic; lintst; toc
100 / 100 passed
Elapsed time is 13.5458 seconds.

32-bit Octave on 64-bit Win7:
=====================
>> tic; lintst; toc
100 / 100 passed
Elapsed time is 10.9326 seconds.

64-bit Octave on 64-bit Linux
=================
>> tic; lintst; toc
100 / 100 passed
Elapsed time is 35.7887 seconds.


It was quite against my expectations to see 32-bit Octave being quite a bit faster than 64-bit Octave; when reading & processing large .mat files at work I often experience it differently.

I figured the slow results from the Linux side were probably due to having reference BLAS rather than OpenBLAS. So I ran it again with a older 64-indexing 3.9.0+ build (built using MXE) where I had a symlink from libblas.so-> libopenblas.so. Results:

octave:3> tic; lintst; toc
100 / 100 passed
Elapsed time is 36.582 seconds.


Philip Nienhuis <philipnienhuis>
Group Member
Thu 02 Apr 2015 07:26:55 PM UTC, comment #2: 

It's the same hardware.  I run Linux on the bare metal and Windows XP as a virtual machine within Linux.

Information on csrss.exe is here (http://en.wikipedia.org/wiki/Client/Server_Runtime_Subsystem).  

It appears that csrss is invoked whenever there are console operations.  During for loops, Octave may be checking the console repeatedly for a 'Ctrl+C' character which is actually causing the crazy amount of activity I see.

This is another example which shows only 8-18% CPU usage for csrss.exe.


for i = 1:2e3
  x = rand (50,50);
endfor


Rik <rik5>
Group administrator
Thu 02 Apr 2015 06:13:03 PM UTC, comment #1: 

Is that comparing like (or same) machines running windows and Linux, or virtual OS?

Not that it can be used to compare time, but running on my Win7 laptop, the BIST test takes 30 seconds, but I don't have any issue with csrss.exe running high CPU.

octave was running a little under 10% during the test.

Perhaps related however, each time I did the run, the virus scanner decided to run 20%, until I turned it off. It consistently did that each time I ran the test.

With virus scanner off, I got down to 22 seconds.

John Donoghue <lostbard>
Group Member
Thu 02 Apr 2015 05:31:59 PM UTC, original submission:  

While debugging another issue I wrote a small script to run the BIST tests in linsolve.m 100 times.  This script is attached as lintst.m

Running


tic; lintst; toc


as a quick benchmark I find dramatically slower behavior on Windows XP than Linux.  At the same time that the Octave is running the code I see that the csrss.exe process is taking about 75% of the CPU.  As soon as the code completes the csrss.exe process drops back to non-existent.


Results:


Linux
GUI : 7.9 seconds
CLI : 6.3 seconds

Windows XP
GUI : 72.4 seconds
CLI : 58.1 seconds




Rik <rik5>
Group administrator

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33517:  lintst.m added by rik5 (103B - text/x-objcsrc)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Posted a comment)
  • -email is unavailable- added by lostbard (Posted a comment)
  • -email is unavailable- added by rik5 (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-10 rik5 StatusNone Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2015-04-02 rik5 Attached File- Added lintst.m, #33517

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code