<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804</link>
    <title>MATLAB Central Newsreader - Speed Comparison</title>
    <description>Feed for thread: Speed Comparison</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 10 Apr 2009 23:26:02 -0400</pubDate>
      <title>Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641933</link>
      <author>Sky </author>
      <description>I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&lt;br&gt;
Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&lt;br&gt;
Is this possible? Is MATLAB this slow or am I doing something wrong?</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 00:15:03 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641935</link>
      <author>James Tursa</author>
      <description>&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&lt;br&gt;
Yes, it is certainly possible, as you have already demonstrated. Speed comparisons like this are highly dependent on how you did the port and what the MATLAB code is actually doing. There is a potentially a lot of overhead on the MATLAB side that does not exist in the Fortran. E.g., Are you building an array inside a loop without preallocating? Are you manipulating variables in a way that causes a lot of data copying that doesn't exist in the Fortran? Can your nested for-loops in the MATLAB code be vectorized? Etc. etc. Impossible to say if you did anything *wrong* without seeing the code.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 00:34:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641938</link>
      <author>Chaos </author>
      <description>&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&lt;br&gt;
Learn how to use mex to compile your fortran code with Intel ifort and use Matlab as front-end to your code and make nice plots when done.  You'll get most of your speed back.&lt;br&gt;
&lt;br&gt;
Fortran is great! It is a THE numerical, balls to the wall, sledgehammer, especially if you implement OpenMP or MPI in your loops.  Any F77/F95 code vs Matlab both at the same level of competency, Fortran will absolutely STOMP Matlab.&lt;br&gt;
&lt;br&gt;
Matlab/C++ are 'Swiss Army' knives built for anything and everything.  Fortran doesn't do many things well, you don't use it to make nice GUI's or plots but what it does well better than any other language is number crunch, high-precision, complex, 32/64 bit.&lt;br&gt;
&lt;br&gt;
Where did you get that copy of Compaq Visual Fort? They stopped making that years ago.</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 02:04:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641945</link>
      <author>James Tursa</author>
      <description>&quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;groohp$l15$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Where did you get that copy of Compaq Visual Fort? They stopped making that years ago.&lt;br&gt;
&lt;br&gt;
... and I wish I could find a copy for a reasonable price. I would like to be able to test my Fortran code on the Compaq or Digital compiler (I currently have Intel 10.0) so that when I post mex code to the FEX I can be reasonably assured that it will work for them. But I am not willing to pay hundreds of dollars just to get this capability.&lt;br&gt;
&lt;br&gt;
James Tursa</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 03:29:16 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641947</link>
      <author>Lada Kugis</author>
      <description>On Sat, 11 Apr 2009 00:34:01 +0000 (UTC), &quot;Chaos&quot;&lt;br&gt;
&amp;lt;rothko.fan@gmail.com&amp;gt; wrote:&lt;br&gt;
&lt;br&gt;
&amp;gt;&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt;&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt;&amp;gt; &lt;br&gt;
&amp;gt;&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Learn how to use mex to compile your fortran code with Intel ifort and use Matlab as front-end to your code and make nice plots when done.  You'll get most of your speed back.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Fortran is great! It is a THE numerical, balls to the wall, sledgehammer, especially if you implement OpenMP or MPI in your loops.  Any F77/F95 code vs Matlab both at the same level of competency, Fortran will absolutely STOMP Matlab.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Matlab/C++ are 'Swiss Army' knives built for anything and everything.  Fortran doesn't do many things well, you don't use it to make nice GUI's or plots but what it does well better than any other language is number crunch, high-precision, complex, 32/64 bit.&lt;br&gt;
&lt;br&gt;
Sorry if I'm jumping into a discussion like this, but&lt;br&gt;
do you know where one can find examples of this (gui frontend for&lt;br&gt;
fortran code) - maybe a book or two where such is explained for&lt;br&gt;
someone who's never done much gui programming ?&lt;br&gt;
&lt;br&gt;
best regards&lt;br&gt;
Lada&lt;br&gt;
&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;Where did you get that copy of Compaq Visual Fort? They stopped making that years ago.</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 03:38:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641948</link>
      <author>Chaos </author>
      <description>Lada Kugis &amp;lt;lada.kugis@gmail.com&amp;gt; wrote in message &amp;lt;q530u4tftttaenhbov4p9apjuv3am44bb2@4ax.com&amp;gt;...&lt;br&gt;
&amp;gt; On Sat, 11 Apr 2009 00:34:01 +0000 (UTC), &quot;Chaos&quot;&lt;br&gt;
&amp;gt; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt;&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;Learn how to use mex to compile your fortran code with Intel ifort and use Matlab as front-end to your code and make nice plots when done.  You'll get most of your speed back.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;Fortran is great! It is a THE numerical, balls to the wall, sledgehammer, especially if you implement OpenMP or MPI in your loops.  Any F77/F95 code vs Matlab both at the same level of competency, Fortran will absolutely STOMP Matlab.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;Matlab/C++ are 'Swiss Army' knives built for anything and everything.  Fortran doesn't do many things well, you don't use it to make nice GUI's or plots but what it does well better than any other language is number crunch, high-precision, complex, 32/64 bit.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Sorry if I'm jumping into a discussion like this, but&lt;br&gt;
&amp;gt; do you know where one can find examples of this (gui frontend for&lt;br&gt;
&amp;gt; fortran code) - maybe a book or two where such is explained for&lt;br&gt;
&amp;gt; someone who's never done much gui programming ?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; best regards&lt;br&gt;
&amp;gt; Lada&lt;br&gt;
&lt;br&gt;
The GUI front-end would be a collection of Matlab widgets, plots, etc.  whatever is needed.  The main engine would be a mex call to the compiled fortran code.  I don't use GUI's I'm hardcore command line person but look for here&lt;br&gt;
&lt;br&gt;
grep the help docs for &quot;Creating Graphical User Interfaces&quot;</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 03:49:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641949</link>
      <author>Chaos </author>
      <description>&quot;James Tursa&quot; &amp;lt;aclassyguywithaknotac@hotmail.com&amp;gt; wrote in message &amp;lt;grotqh$b3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;groohp$l15$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Where did you get that copy of Compaq Visual Fort? They stopped making that years ago.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ... and I wish I could find a copy for a reasonable price. I would like to be able to test my Fortran code on the Compaq or Digital compiler (I currently have Intel 10.0) so that when I post mex code to the FEX I can be reasonably assured that it will work for them. But I am not willing to pay hundreds of dollars just to get this capability.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; James Tursa&lt;br&gt;
&lt;br&gt;
Did you check Ebay?&lt;br&gt;
&lt;br&gt;
After HP dropped 'Compaq' Fortran, i read most of the developers are now working at Intel, must be why the latest version 11.0 is posting some impressive numbers.&lt;br&gt;
&lt;br&gt;
I remember that old MS version of Fortran, what a piece of junk.</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 09:15:02 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641974</link>
      <author>Steve Amphlett</author>
      <description>&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&lt;br&gt;
I can understand the speedup from MATAB to CVF, a factor of up to 20.  But a factor of 1000 between CVF and for ifort?  I don't remember anything that dramatic when we switched from CVF to ifort.</description>
    </item>
    <item>
      <pubDate>Sat, 11 Apr 2009 10:57:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#641993</link>
      <author>Chaos </author>
      <description>&quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&lt;br&gt;
CVF -&amp;gt; no OpenMP, no SSE2, no SSE3, no parallelzation, no Real(16), old version of IMSL</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 03:34:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#642065</link>
      <author>Sky </author>
      <description>@Tursa: I took the necessary precautions i.e. pre-allocation, vectorization wherever possible etc.&lt;br&gt;
&lt;br&gt;
@Chaos: I dusted off an old copy of CVF6 just to run this comparison. I am going to take your advice and stick to FORTRAN. I am turning the old code into a COM server. I think that will give me the most choice as far as interoperability is concerned.&lt;br&gt;
&lt;br&gt;
Thanks to everyone for their comments.</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 12:29:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#642096</link>
      <author>Steve Amphlett</author>
      <description>&quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;grpt1t$i1e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; CVF -&amp;gt; no OpenMP, no SSE2, no SSE3, no parallelzation, no Real(16), old version of IMSL&lt;br&gt;
&lt;br&gt;
True, but it still doesn't add up to a 1000 speed multiplier.  OpenMP for a 2 CPU, maybe 1.7x, SSE2 and/or SSE3, maybe 2x more.&lt;br&gt;
&lt;br&gt;
If I saw these ratios, I'd be woderring if we were comparing bebug with mega-complied code.&lt;br&gt;
&lt;br&gt;
The outputs of some profiling tests would be interesting.</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 12:34:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#642097</link>
      <author>Steve Amphlett</author>
      <description>&quot;Steve Amphlett&quot; &amp;lt;Firstname.Lastname@Where-I-Work.com&amp;gt; wrote in message &amp;lt;grsmqd$6e3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;grpt1t$i1e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; CVF -&amp;gt; no OpenMP, no SSE2, no SSE3, no parallelzation, no Real(16), old version of IMSL&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; True, but it still doesn't add up to a 1000 speed multiplier.  OpenMP for a 2 CPU, maybe 1.7x, SSE2 and/or SSE3, maybe 2x more.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If I saw these ratios, I'd be woderring if we were comparing bebug with mega-complied code.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; The outputs of some profiling tests would be interesting.&lt;br&gt;
&lt;br&gt;
... My work PC might still have DVF/CVF on it (I still have the media) as well an ifort (v10 I think, possibly v11).  I may run some speed tests using some trivial FORTRAN code with FP loops.  If there really is a 1000 speedup I'd like to know how to get it.</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 13:12:01 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#642102</link>
      <author>Chaos </author>
      <description>&quot;Steve Amphlett&quot; &amp;lt;Firstname.Lastname@Where-I-Work.com&amp;gt; wrote in message &amp;lt;grsn3p$n9l$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Steve Amphlett&quot; &amp;lt;Firstname.Lastname@Where-I-Work.com&amp;gt; wrote in message &amp;lt;grsmqd$6e3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;grpt1t$i1e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; CVF -&amp;gt; no OpenMP, no SSE2, no SSE3, no parallelzation, no Real(16), old version of IMSL&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; True, but it still doesn't add up to a 1000 speed multiplier.  OpenMP for a 2 CPU, maybe 1.7x, SSE2 and/or SSE3, maybe 2x more.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; If I saw these ratios, I'd be woderring if we were comparing bebug with mega-complied code.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; The outputs of some profiling tests would be interesting.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; ... My work PC might still have DVF/CVF on it (I still have the media) as well an ifort (v10 I think, possibly v11).  I may run some speed tests using some trivial FORTRAN code with FP loops.  If there really is a 1000 speedup I'd like to know how to get it.&lt;br&gt;
&lt;br&gt;
if his routine using quad cpu, he'll get at almost 3.8X speed, if he's liked to MKL FFTW or ACML lib at least another 2 to 4X per cpu</description>
    </item>
    <item>
      <pubDate>Sun, 12 Apr 2009 17:38:00 -0400</pubDate>
      <title>Re: Speed Comparison</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/248804#642136</link>
      <author>Steve Amphlett</author>
      <description>&quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;grspb1$ds8$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Steve Amphlett&quot; &amp;lt;Firstname.Lastname@Where-I-Work.com&amp;gt; wrote in message &amp;lt;grsn3p$n9l$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &quot;Steve Amphlett&quot; &amp;lt;Firstname.Lastname@Where-I-Work.com&amp;gt; wrote in message &amp;lt;grsmqd$6e3$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &quot;Chaos&quot; &amp;lt;rothko.fan@gmail.com&amp;gt; wrote in message &amp;lt;grpt1t$i1e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &quot;Sky &quot; &amp;lt;theskyishigh@yahoo.com&amp;gt; wrote in message &amp;lt;grokia$rcq$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; I have ported a code from FORTRAN95 to MATLAB. Replicated it almost exactly. About 500 lines in length, it contains a lot of double precision arithmetic and nested iterations. Very little linear algebra.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Under MATLAB R2008b it executes in 7.3 seconds. Compiled under Compaq Visual Fortran 6 it takes 375 milliseconds. Under the Intel Fortran 11 compiler, it takes 473 MICROseconds. These times are for a WinXP system, Core 2 Duo 2 GHz (4MB L2 Cache), 2GB RAM...&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &amp;gt; Is this possible? Is MATLAB this slow or am I doing something wrong?&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &amp;gt; CVF -&amp;gt; no OpenMP, no SSE2, no SSE3, no parallelzation, no Real(16), old version of IMSL&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; True, but it still doesn't add up to a 1000 speed multiplier.  OpenMP for a 2 CPU, maybe 1.7x, SSE2 and/or SSE3, maybe 2x more.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; If I saw these ratios, I'd be woderring if we were comparing bebug with mega-complied code.&lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; &amp;gt; The outputs of some profiling tests would be interesting.&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; ... My work PC might still have DVF/CVF on it (I still have the media) as well an ifort (v10 I think, possibly v11).  I may run some speed tests using some trivial FORTRAN code with FP loops.  If there really is a 1000 speedup I'd like to know how to get it.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; if his routine using quad cpu, he'll get at almost 3.8X speed, if he's liked to MKL FFTW or ACML lib at least another 2 to 4X per cpu&lt;br&gt;
&lt;br&gt;
With all respect, do the multiplications.  OP has 2 cores, 4x speedup per core is still only 8x (assuming OMP).  Add in another (unlikely) 2x for compiler tech and (optimistically) 2x for chip instruction set optimization and you're still only at 32x.  Need to find a reason for the additional 30x.&lt;br&gt;
&lt;br&gt;
A big problem that takes many tens of seconds needs to be benchmarked.</description>
    </item>
  </channel>
</rss>

