<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>Comments on: Julia!</title>
	<atom:link href="http://artent.net/2012/08/29/609/feed/" rel="self" type="application/rss+xml" />
	<link>http://artent.net/2012/08/29/609/</link>
	<description>We&#039;re blogging machines!</description>
	<lastBuildDate>Wed, 15 Jan 2025 16:08:06 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.0</generator>
	<item>
		<title>By: Artificial Intelligence Blog &#183; Julia Language</title>
		<link>http://artent.net/2012/08/29/609/#comment-175</link>
		<dc:creator><![CDATA[Artificial Intelligence Blog &#183; Julia Language]]></dc:creator>
		<pubDate>Wed, 26 Sep 2012 19:15:42 +0000</pubDate>
		<guid isPermaLink="false">http://162.243.213.31/?p=609#comment-175</guid>
		<description><![CDATA[[...] For a speed comparison with Matlab, see this post. [...]]]></description>
		<content:encoded><![CDATA[<p>[...] For a speed comparison with Matlab, see this post. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hundalhh</title>
		<link>http://artent.net/2012/08/29/609/#comment-106</link>
		<dc:creator><![CDATA[hundalhh]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 17:44:48 +0000</pubDate>
		<guid isPermaLink="false">http://162.243.213.31/?p=609#comment-106</guid>
		<description><![CDATA[My friend Glen suggested the benchmarks below.  The results were 25 seconds for the C program and 11.06 seconds for Julia.

&lt;pre style=&quot;line-height: 10pt;&quot;&gt;
Julia code:

function bench11( iMax )
    a=1000.00;
    f = 11.0;
    for i=0:(iMax-1)
        b=float32(i)
        c=sin(b/a)
        d=cos(b/a)
        f=sqrt(c*c + d*d) + c + d + f
    end
    f
end

Julia interactive session:

julia&gt; tic(); bench11(100000000); toc()
elapsed time: 11.062000036239624 seconds
11.062000036239624

julia&gt; bench11(100000000)
1.0000204708268365e8


C++ code:

#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

int main()
{
  double a,b,c,d,e;
  //double sin(), cos(), sqrt();
  register int i;

  a=1000.00;
  e= 11.0;
  for (i=0; i &lt; 100000000; i++)
  {
    b=(double) i;
    c=sin(b/a);
    d=cos(b/a);
    e=sqrt(c*c + d*d) + c + d + e;
  }

  printf(&quot;e = %10.5f\n&quot;, (float) e);

  return 1;

Call to the C code:

date; ./a.exe; date
Wed Aug 29 10:50:35 EDT 2012
e = 100002048.00000
Wed Aug 29 10:51:06 EDT 2012
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>My friend Glen suggested the benchmarks below.  The results were 25 seconds for the C program and 11.06 seconds for Julia.</p>
<pre style="line-height: 10pt;">
Julia code:

function bench11( iMax )
    a=1000.00;
    f = 11.0;
    for i=0:(iMax-1)
        b=float32(i)
        c=sin(b/a)
        d=cos(b/a)
        f=sqrt(c*c + d*d) + c + d + f
    end
    f
end

Julia interactive session:

julia&gt; tic(); bench11(100000000); toc()
elapsed time: 11.062000036239624 seconds
11.062000036239624

julia&gt; bench11(100000000)
1.0000204708268365e8


C++ code:

#include &lt;stdio.h&gt;
#include &lt;math.h&gt;

int main()
{
  double a,b,c,d,e;
  //double sin(), cos(), sqrt();
  register int i;

  a=1000.00;
  e= 11.0;
  for (i=0; i &lt; 100000000; i++)
  {
    b=(double) i;
    c=sin(b/a);
    d=cos(b/a);
    e=sqrt(c*c + d*d) + c + d + e;
  }

  printf("e = %10.5f\n", (float) e);

  return 1;

Call to the C code:

date; ./a.exe; date
Wed Aug 29 10:50:35 EDT 2012
e = 100002048.00000
Wed Aug 29 10:51:06 EDT 2012
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: antianticamper</title>
		<link>http://artent.net/2012/08/29/609/#comment-105</link>
		<dc:creator><![CDATA[antianticamper]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 16:35:56 +0000</pubDate>
		<guid isPermaLink="false">http://162.243.213.31/?p=609#comment-105</guid>
		<description><![CDATA[It may be fast but if I have to rewrite all the Matlab toolboxes it&#039;s slow.]]></description>
		<content:encoded><![CDATA[<p>It may be fast but if I have to rewrite all the Matlab toolboxes it&#8217;s slow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hundalhh</title>
		<link>http://artent.net/2012/08/29/609/#comment-104</link>
		<dc:creator><![CDATA[hundalhh]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 13:14:44 +0000</pubDate>
		<guid isPermaLink="false">http://162.243.213.31/?p=609#comment-104</guid>
		<description><![CDATA[Glen wrote:

Be careful what conclusions you make!

We went through this with Fortran compilers 30 years ago.
A machine from Gould was so much faster than the VAX
that it made your head spin.

Turns out that the Gould compiler did some dependancy
analysis and pruned all code where the results were
never used. So we added the result of the loop to an
accumulator. And that one REAL value was printed at the
end. The run time for the Gould went up by 3 orders of
magnitude and was then close to the VAX.

If Julia&#039;s numbers hold up with different code, I am happy.
I&#039;m just saying don&#039;t let yourself get faked out by a smart 
compiler.

- G]]></description>
		<content:encoded><![CDATA[<p>Glen wrote:</p>
<p>Be careful what conclusions you make!</p>
<p>We went through this with Fortran compilers 30 years ago.<br />
A machine from Gould was so much faster than the VAX<br />
that it made your head spin.</p>
<p>Turns out that the Gould compiler did some dependancy<br />
analysis and pruned all code where the results were<br />
never used. So we added the result of the loop to an<br />
accumulator. And that one REAL value was printed at the<br />
end. The run time for the Gould went up by 3 orders of<br />
magnitude and was then close to the VAX.</p>
<p>If Julia&#8217;s numbers hold up with different code, I am happy.<br />
I&#8217;m just saying don&#8217;t let yourself get faked out by a smart<br />
compiler.</p>
<p>&#8211; G</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hundalhh</title>
		<link>http://artent.net/2012/08/29/609/#comment-103</link>
		<dc:creator><![CDATA[hundalhh]]></dc:creator>
		<pubDate>Wed, 29 Aug 2012 13:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://162.243.213.31/?p=609#comment-103</guid>
		<description><![CDATA[My friend Chris wrote:

Interesting. A quick check with a C++ program to do the same thing suggests that Julia is giving performance comparable to C++ — assuming Hein and I were using the same computer, which we&#039;re not.

&lt;pre style=&quot;line-height: 10pt;&quot;&gt;
Here&#039;s my code:
#include &lt;cmath&gt;
#include &lt;iostream&gt;
#include &lt;sys/time.h&gt;
using namespace std;

bool primeQ(long i){
	for (int j = 2; j &lt; ceil((double)i/2.0); j++){
		if (i % j == 0){
		return false;
		}
	}
	return true;
}

int main(int argc, char** argv){
	timeval time;
	gettimeofday(&amp;time, NULL);
	long millis1 = (time.tv_sec * 1000) + (time.tv_usec / 1000);
	bool b = primeQ(71378569);
	
	gettimeofday(&amp;time, NULL);
	long millis2 = (time.tv_sec * 1000) + (time.tv_usec / 1000);
	if (b){
		cout &lt;&lt; &quot;Prime!&quot; &lt;&lt; endl;
	}else{
		cout &lt;&lt; &quot;Not so prime!&quot; &lt;&lt; endl;
	}
	cout &lt;&lt; (double)(millis2 - millis1) / (double)1000 &lt;&lt; &quot; seconds&quot; &lt;&lt; endl;
}

The running time is about ~0.32 seconds when I run assuming I compile with –O3 for optimization.

Cheers,
Chris
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>My friend Chris wrote:</p>
<p>Interesting. A quick check with a C++ program to do the same thing suggests that Julia is giving performance comparable to C++ — assuming Hein and I were using the same computer, which we&#8217;re not.</p>
<pre style="line-height: 10pt;">
Here's my code:
#include &lt;cmath&gt;
#include &lt;iostream&gt;
#include &lt;sys/time.h&gt;
using namespace std;

bool primeQ(long i){
	for (int j = 2; j &lt; ceil((double)i/2.0); j++){
		if (i % j == 0){
		return false;
		}
	}
	return true;
}

int main(int argc, char** argv){
	timeval time;
	gettimeofday(&#038;time, NULL);
	long millis1 = (time.tv_sec * 1000) + (time.tv_usec / 1000);
	bool b = primeQ(71378569);
	
	gettimeofday(&#038;time, NULL);
	long millis2 = (time.tv_sec * 1000) + (time.tv_usec / 1000);
	if (b){
		cout &lt;&lt; "Prime!" &lt;&lt; endl;
	}else{
		cout &lt;&lt; "Not so prime!" &lt;&lt; endl;
	}
	cout &lt;&lt; (double)(millis2 - millis1) / (double)1000 &lt;&lt; " seconds" &lt;&lt; endl;
}

The running time is about ~0.32 seconds when I run assuming I compile with –O3 for optimization.

Cheers,
Chris
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: artent.net @ 2026-04-22 09:52:55 by W3 Total Cache -->