<?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 for Marco Mastrodonato</title>
	<atom:link href="http://mastrodonato.info/index.php/comments/feed/?lang=en" rel="self" type="application/rss+xml" />
	<link>http://mastrodonato.info?lang=en</link>
	<description>Non c&#039;e&#039; prezzo per la miticita&#039;</description>
	<lastBuildDate>Mon, 07 Jun 2010 16:04:06 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>Comment on Ruby vs Python vs Windows vs Linux by Marco Mastrodonato</title>
		<link>http://mastrodonato.info/index.php/2010/03/ruby-vs-python-vs-windows-vs-linux-2/comment-page-1/?lang=en#comment-7554</link>
		<dc:creator>Marco Mastrodonato</dc:creator>
		<pubDate>Mon, 07 Jun 2010 16:04:06 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=441#comment-7554</guid>
		<description>&gt; roger
&gt; 28 May 2010 at 18:23
&gt; 
&gt; Surprising to see Ruby 1.9.1 p129 i386-mingw32 ahead of its linux counterpart (?)
&gt; 
&gt; Also note that rubinius is fast (maybe pypy is fast, too, or unladden swallow?)

&gt; Also note that jruby has a new version released now.

Unfortunatelly, i didn&#039;t find the p129 for linux. Anyway, it didn&#039;t seem to much stable compared newer versions so i don&#039;t use it any more.

I&#039;ve just noticed has been released jruby 1.5,  thanks! I will try it as soon as possible.</description>
		<content:encoded><![CDATA[<p>> roger<br />
> 28 May 2010 at 18:23<br />
><br />
> Surprising to see Ruby 1.9.1 p129 i386-mingw32 ahead of its linux counterpart (?)<br />
><br />
> Also note that rubinius is fast (maybe pypy is fast, too, or unladden swallow?)</p>
<p>> Also note that jruby has a new version released now.</p>
<p>Unfortunatelly, i didn&#8217;t find the p129 for linux. Anyway, it didn&#8217;t seem to much stable compared newer versions so i don&#8217;t use it any more.</p>
<p>I&#8217;ve just noticed has been released jruby 1.5,  thanks! I will try it as soon as possible.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby vs Ruby vs Python vs Python by Marco Mastrodonato</title>
		<link>http://mastrodonato.info/index.php/2010/01/ruby-vs-ruby-vs-python-vs-python-2/comment-page-1/?lang=en#comment-2986</link>
		<dc:creator>Marco Mastrodonato</dc:creator>
		<pubDate>Tue, 26 Jan 2010 21:53:11 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=403#comment-2986</guid>
		<description>Added a warm up test then i took the three readings shown in the second chart. I updated the scripts as well.</description>
		<content:encoded><![CDATA[<p>Added a warm up test then i took the three readings shown in the second chart. I updated the scripts as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby vs Ruby vs Python vs Python by Marco Mastrodonato</title>
		<link>http://mastrodonato.info/index.php/2010/01/ruby-vs-ruby-vs-python-vs-python-2/comment-page-1/?lang=en#comment-2966</link>
		<dc:creator>Marco Mastrodonato</dc:creator>
		<pubDate>Tue, 26 Jan 2010 08:17:26 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=403#comment-2966</guid>
		<description>Hi roger,
damn, i forgot to warm up the jvm. I see jruby slightly increase the performance, i will have to repeat the compares!

I only used --server, however also adding --fast, there&#039;s no difference on my system.
I have ubuntu in that notebook, nextly i could do another bench though i think on linux there will be less difference. Usually, on linux you make the binary by yourself, on windows instead, people are lazier and they downloads the binary.</description>
		<content:encoded><![CDATA[<p>Hi roger,<br />
damn, i forgot to warm up the jvm. I see jruby slightly increase the performance, i will have to repeat the compares!</p>
<p>I only used &#8211;server, however also adding &#8211;fast, there&#8217;s no difference on my system.<br />
I have ubuntu in that notebook, nextly i could do another bench though i think on linux there will be less difference. Usually, on linux you make the binary by yourself, on windows instead, people are lazier and they downloads the binary.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Ruby vs Ruby vs Python vs Python by roger</title>
		<link>http://mastrodonato.info/index.php/2010/01/ruby-vs-ruby-vs-python-vs-python-2/comment-page-1/?lang=en#comment-2942</link>
		<dc:creator>roger</dc:creator>
		<pubDate>Mon, 25 Jan 2010 18:51:58 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=403#comment-2942</guid>
		<description>did you try jruby --fast --server (and give it plenty of warm up time?)
(also a linux test would be interesting)</description>
		<content:encoded><![CDATA[<p>did you try jruby &#8211;fast &#8211;server (and give it plenty of warm up time?)<br />
(also a linux test would be interesting)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Comparison script languages for the fractal geometry by Michele</title>
		<link>http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/comment-page-1/?lang=en#comment-52</link>
		<dc:creator>Michele</dc:creator>
		<pubDate>Thu, 01 Oct 2009 15:34:41 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=339#comment-52</guid>
		<description>Hi bc, i tested your code but it doesn&#039;t work.

NameError: global name &#039;MAX_ITERATIONS&#039; is not defined

I added MAX_ITERATIONS = 50
and 
NameError: global name &#039;BAILOUT&#039; is not defined

I added BAILOUT = 10
and 
NameError: global name &#039;logical_not&#039; is not defined

Than i stopped.

Can you send us the correct code,  please?

Bye  Michele.</description>
		<content:encoded><![CDATA[<p>Hi bc, i tested your code but it doesn&#8217;t work.</p>
<p>NameError: global name &#8216;MAX_ITERATIONS&#8217; is not defined</p>
<p>I added MAX_ITERATIONS = 50<br />
and<br />
NameError: global name &#8216;BAILOUT&#8217; is not defined</p>
<p>I added BAILOUT = 10<br />
and<br />
NameError: global name &#8216;logical_not&#8217; is not defined</p>
<p>Than i stopped.</p>
<p>Can you send us the correct code,  please?</p>
<p>Bye  Michele.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Comparison script languages for the fractal geometry by Marco Mastrodonato</title>
		<link>http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/comment-page-1/?lang=en#comment-49</link>
		<dc:creator>Marco Mastrodonato</dc:creator>
		<pubDate>Wed, 30 Sep 2009 12:16:54 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=339#comment-49</guid>
		<description>@Bc
I knew psyco JIT to optimize performance but i&#039;ve never heard numpy before. It could be usefull for other readers, thanks.

@Romuald
Thank you for your improvements. I update the compare as soon as possible</description>
		<content:encoded><![CDATA[<p>@Bc<br />
I knew psyco JIT to optimize performance but i&#8217;ve never heard numpy before. It could be usefull for other readers, thanks.</p>
<p>@Romuald<br />
Thank you for your improvements. I update the compare as soon as possible</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Comparison script languages for the fractal geometry by Romuald</title>
		<link>http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/comment-page-1/?lang=en#comment-48</link>
		<dc:creator>Romuald</dc:creator>
		<pubDate>Wed, 30 Sep 2009 08:59:20 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=339#comment-48</guid>
		<description>Hello

Here is a better perl version : http://pastebin.com/d74858d17

Two majors changes:
- use &quot;my&quot; instead of &quot;local&quot; (slower and doesn&#039;t make sense in this context: it&#039;s used to localize the value of one variable to a block, resetting is to it&#039;s previous value once out of the block)
- use Time::HiRes module since time() does not return microseconds</description>
		<content:encoded><![CDATA[<p>Hello</p>
<p>Here is a better perl version : <a href="http://pastebin.com/d74858d17" rel="nofollow">http://pastebin.com/d74858d17</a></p>
<p>Two majors changes:<br />
- use &#8220;my&#8221; instead of &#8220;local&#8221; (slower and doesn&#8217;t make sense in this context: it&#8217;s used to localize the value of one variable to a block, resetting is to it&#8217;s previous value once out of the block)<br />
- use Time::HiRes module since time() does not return microseconds</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Setting up an environment for jRuby on Rails by eson</title>
		<link>http://mastrodonato.info/index.php/2009/08/setting-up-an-environment-for-jruby-on-rails/comment-page-1/?lang=en#comment-47</link>
		<dc:creator>eson</dc:creator>
		<pubDate>Wed, 30 Sep 2009 01:53:25 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=207#comment-47</guid>
		<description>nice job, thx</description>
		<content:encoded><![CDATA[<p>nice job, thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Comparison script languages for the fractal geometry by bc</title>
		<link>http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/comment-page-1/?lang=en#comment-39</link>
		<dc:creator>bc</dc:creator>
		<pubDate>Sun, 20 Sep 2009 12:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=339#comment-39</guid>
		<description>OK, for an even more efficient numpy implementation try:

class Bench2(object):
....def __init__(self):
........print (&#039;Rendering...&#039;)
........y,x = numpy.mgrid[-39/40.:39/40.:78j, -39/40.:39/40.:78j]
........i = self.start(x,y)
........out = numpy.ones(i.shape, dtype=numpy.byte) * 42
........out[i==0] = 32
........for row in out:
............stdout.write(row.tostring())
............stdout.write(&#039;n&#039;)
....
....def start(self, x, y):
........&quot;&quot;&quot;x &amp; y are now arrays of shape (nx, ny)
........&quot;&quot;&quot;
........c = (y - 0.5) + 1.j*x
........c = c.ravel()
........z = numpy.zeros(c.shape, numpy.complex128)
........idx = numpy.arange(z.size)
........out = numpy.ones(x.shape, numpy.bool)
........out_ = out.ravel()
........for i in xrange(MAX_ITERATIONS):
............z **= 2
............z += c
............mask = (z.real + z.imag) &lt;= BAILOUT
............idx, IDX = idx[mask], idx[logical_not(mask)]
............z = z[mask]
............c = c[mask]
............out_[IDX] = False
........return out

This now goes ~23x faster than the original CPython version (py2.6), although at the cost of less readable code. So there you have it: python is faster than java!

(and this is why python rules for scientific and engineering type applications)</description>
		<content:encoded><![CDATA[<p>OK, for an even more efficient numpy implementation try:</p>
<p>class Bench2(object):<br />
&#8230;.def __init__(self):<br />
&#8230;&#8230;..print (&#8216;Rendering&#8230;&#8217;)<br />
&#8230;&#8230;..y,x = numpy.mgrid[-39/40.:39/40.:78j, -39/40.:39/40.:78j]<br />
&#8230;&#8230;..i = self.start(x,y)<br />
&#8230;&#8230;..out = numpy.ones(i.shape, dtype=numpy.byte) * 42<br />
&#8230;&#8230;..out[i==0] = 32<br />
&#8230;&#8230;..for row in out:<br />
&#8230;&#8230;&#8230;&#8230;stdout.write(row.tostring())<br />
&#8230;&#8230;&#8230;&#8230;stdout.write(&#8216;n&#8217;)<br />
&#8230;.<br />
&#8230;.def start(self, x, y):<br />
&#8230;&#8230;..&#8221;"&#8221;x &amp; y are now arrays of shape (nx, ny)<br />
&#8230;&#8230;..&#8221;"&#8221;<br />
&#8230;&#8230;..c = (y &#8211; 0.5) + 1.j*x<br />
&#8230;&#8230;..c = c.ravel()<br />
&#8230;&#8230;..z = numpy.zeros(c.shape, numpy.complex128)<br />
&#8230;&#8230;..idx = numpy.arange(z.size)<br />
&#8230;&#8230;..out = numpy.ones(x.shape, numpy.bool)<br />
&#8230;&#8230;..out_ = out.ravel()<br />
&#8230;&#8230;..for i in xrange(MAX_ITERATIONS):<br />
&#8230;&#8230;&#8230;&#8230;z **= 2<br />
&#8230;&#8230;&#8230;&#8230;z += c<br />
&#8230;&#8230;&#8230;&#8230;mask = (z.real + z.imag) &lt;= BAILOUT<br />
&#8230;&#8230;&#8230;&#8230;idx, IDX = idx[mask], idx[logical_not(mask)]<br />
&#8230;&#8230;&#8230;&#8230;z = z[mask]<br />
&#8230;&#8230;&#8230;&#8230;c = c[mask]<br />
&#8230;&#8230;&#8230;&#8230;out_[IDX] = False<br />
&#8230;&#8230;..return out</p>
<p>This now goes ~23x faster than the original CPython version (py2.6), although at the cost of less readable code. So there you have it: python is faster than java!</p>
<p>(and this is why python rules for scientific and engineering type applications)</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Comparison script languages for the fractal geometry by bc</title>
		<link>http://mastrodonato.info/index.php/2009/08/comparison-script-languages-for-the-fractal-geometry/comment-page-1/?lang=en#comment-38</link>
		<dc:creator>bc</dc:creator>
		<pubDate>Sun, 20 Sep 2009 08:23:24 +0000</pubDate>
		<guid isPermaLink="false">http://mastrodonato.info/?p=339#comment-38</guid>
		<description>If you&#039;re doing maths with python, you&#039;d automatically use the numpy library and vectorise the calculation. Here&#039;s a numpy&#039;fied version:

import numpy
from numpy import logical_or
        
class Bench2(object):
    def __init__(self):
        print (&#039;Rendering...&#039;)
        y,x = numpy.mgrid[-1.:1.:80j, -1.:1.:80j]
        i = self.start(x,y)
        out = numpy.ones(i.shape, dtype=numpy.byte) * 32
        out[i==0] = 42
        for row in out:
            stdout.write(row.tostring())
            stdout.write(&#039;n&#039;)
    
    def start(self, x, y):
        &quot;&quot;&quot;x &amp; y are now arrays of shape (nx, ny)
        &quot;&quot;&quot;
        c = (y - 0.5) + 1.j*x
        z = numpy.zeros(c.shape, numpy.complex128)
        mask = numpy.zeros(c.shape, numpy.bool)
        for i in xrange(MAX_ITERATIONS):
            z2 = z**2 + c
            mask = logical_or(mask, (z2.real + z2.imag) &gt; BAILOUT, mask)
            z = z2
        return mask

On my machine this runs 3.75x faster than the vanilla CPython version. In fact, even easier is to use Cython, add a few type-defs and get raw C-speed.</description>
		<content:encoded><![CDATA[<p>If you&#8217;re doing maths with python, you&#8217;d automatically use the numpy library and vectorise the calculation. Here&#8217;s a numpy&#8217;fied version:</p>
<p>import numpy<br />
from numpy import logical_or</p>
<p>class Bench2(object):<br />
    def __init__(self):<br />
        print (&#8216;Rendering&#8230;&#8217;)<br />
        y,x = numpy.mgrid[-1.:1.:80j, -1.:1.:80j]<br />
        i = self.start(x,y)<br />
        out = numpy.ones(i.shape, dtype=numpy.byte) * 32<br />
        out[i==0] = 42<br />
        for row in out:<br />
            stdout.write(row.tostring())<br />
            stdout.write(&#8216;n&#8217;)</p>
<p>    def start(self, x, y):<br />
        &#8220;&#8221;"x &amp; y are now arrays of shape (nx, ny)<br />
        &#8220;&#8221;"<br />
        c = (y &#8211; 0.5) + 1.j*x<br />
        z = numpy.zeros(c.shape, numpy.complex128)<br />
        mask = numpy.zeros(c.shape, numpy.bool)<br />
        for i in xrange(MAX_ITERATIONS):<br />
            z2 = z**2 + c<br />
            mask = logical_or(mask, (z2.real + z2.imag) &gt; BAILOUT, mask)<br />
            z = z2<br />
        return mask</p>
<p>On my machine this runs 3.75x faster than the vanilla CPython version. In fact, even easier is to use Cython, add a few type-defs and get raw C-speed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
