<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
    <channel>
        <title>Benchmarks - Tag - In a past life…</title>
        <link>https://archive.jtimothyking.com/tags/benchmarks/</link>
        <description>Benchmarks - Tag - In a past life…</description>
        <generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Thu, 12 Dec 2013 13:00:58 &#43;0000</lastBuildDate><atom:link href="https://archive.jtimothyking.com/tags/benchmarks/" rel="self" type="application/rss+xml" /><item>
    <title>Benchmarking Perl 6: How Ready for Prime Time Is It?</title>
    <link>https://archive.jtimothyking.com/2013/12/12/benchmarking-perl-6-how-ready-for-prime-time-is-it/</link>
    <pubDate>Thu, 12 Dec 2013 13:00:58 &#43;0000</pubDate>
    <author>J. Timothy King</author>
    <guid>https://archive.jtimothyking.com/2013/12/12/benchmarking-perl-6-how-ready-for-prime-time-is-it/</guid>
    <description><![CDATA[<figure class="alignright size-medium"><a class="lightgallery" href="/2013/12/12/benchmarking-perl-6-how-ready-for-prime-time-is-it/CamelRacingCamelCup2009Heat.jpg" title="Racing at the 2009 Camel Cup in Alice Springs, Australia Photo © 2009 Toby Hudson CC BY-SA" data-thumbnail="/2013/12/12/benchmarking-perl-6-how-ready-for-prime-time-is-it/CamelRacingCamelCup2009Heat.jpg" data-sub-html="<h2>Racing at the 2009 Camel Cup in Alice Springs, AustraliaPhoto © 2009 Toby Hudson CC BY-SA</h2><p>Racing at the 2009 Camel Cup in Alice Springs, Australia Photo © 2009 Toby Hudson CC BY-SA</p>">
        
    </a><figcaption class="image-caption">Racing at the 2009 Camel Cup in Alice Springs, Australia<br />Photo © 2009 Toby Hudson CC BY-SA</figcaption></figure>
<p>Here are the slides from the talk I gave at this month&rsquo;s Boston Perl Mongers meeting, this past Tuesday: <a href='Benchmarking-Perl-6-How-Ready-for-Prime-Time-Is-It-revised.pdf'>Benchmarking Perl 6: How Ready for Prime Time Is It?</a></p>]]></description>
</item>
<item>
    <title>How Fast (or Slow) Is Perl 6?</title>
    <link>https://archive.jtimothyking.com/2013/09/17/how-fast-or-slow-is-perl-6/</link>
    <pubDate>Tue, 17 Sep 2013 12:00:22 &#43;0000</pubDate>
    <author>J. Timothy King</author>
    <guid>https://archive.jtimothyking.com/2013/09/17/how-fast-or-slow-is-perl-6/</guid>
    <description><![CDATA[<figure class="alignright size-medium"><a class="lightgallery" href="/2013/09/17/how-fast-or-slow-is-perl-6/CamelRacingCamelCup2009Heat.jpg" title="Racing at the 2009 Camel Cup in Alice Springs, Australia Photo © 2009 Toby Hudson CC BY-SA" data-thumbnail="/2013/09/17/how-fast-or-slow-is-perl-6/CamelRacingCamelCup2009Heat.jpg" data-sub-html="<h2>Racing at the 2009 Camel Cup in Alice Springs, AustraliaPhoto © 2009 Toby Hudson CC BY-SA</h2><p>Racing at the 2009 Camel Cup in Alice Springs, Australia Photo © 2009 Toby Hudson CC BY-SA</p>">
        
    </a><figcaption class="image-caption">Racing at the 2009 Camel Cup in Alice Springs, Australia<br />Photo © 2009 Toby Hudson CC BY-SA</figcaption></figure>
<p>In my previous post, I created a short, simple, sweet, and <em>très élégant</em> <a href="http://sd.jtimothyking.com/2013/09/09/perl-6-and-the-price-of-elegant-code/" title="Perl 6 and the Price of Elegant Code">Perl 6 function to find all the primes up to a given maximum</a>.</p>
<p>Unfortunately, Rakudo spent over 11 seconds to find the 168 primes up to 1000.</p>
<p>Now, granted, this algorithm is exceedingly naïve. It divides every candidate integer by every prime that came before it, resulting in some 91,873 trial divisions (and another 91,873 boolean tests). Even so, that boils down to some 280,000 CPU clock cycles per inner loop (on my old 2.33 GHz Intel Core 2 Duo, with one core tied behind its back).</p>
<p>As a comparison, an implementation of the same algorithm in Perl 5 took only 44 milliseconds to find the same 168 primes using the same number of loops, or about 1100 CPU clock cycles per loop. Still not blazing fast, but more like what I would expect from an interpreted language&hellip; Of course I have Rakudo running on the JVM, and I&rsquo;m benchmarking it after the JIT compiler has squeezed every last little bit of performance it can out of the code it&rsquo;s given. A native-Java implementation ran even faster— but I&rsquo;m getting ahead of myself.</p>]]></description>
</item>
<item>
    <title>Perl 6 and the Price of Elegant Code</title>
    <link>https://archive.jtimothyking.com/2013/09/09/perl-6-and-the-price-of-elegant-code/</link>
    <pubDate>Mon, 09 Sep 2013 12:00:38 &#43;0000</pubDate>
    <author>J. Timothy King</author>
    <guid>https://archive.jtimothyking.com/2013/09/09/perl-6-and-the-price-of-elegant-code/</guid>
    <description><![CDATA[<figure class="alignright size-medium"><a class="lightgallery" href="/2013/09/09/perl-6-and-the-price-of-elegant-code/Camel_Profile_near_Silverton_NSW_07.07.2007.jpg" title="You lookin’ at me?!" data-thumbnail="/2013/09/09/perl-6-and-the-price-of-elegant-code/Camel_Profile_near_Silverton_NSW_07.07.2007.jpg">
        
    </a></figure>
<p>The project that first made me fall in love with Perl&hellip;</p>
<p>Perl 5 had recently launched, with new features for object-oriented programming, includable modules, lexically scoped variables, and references—including closures. At the time, I was writing boot code, diagnostics, and production test software for Kurzweil-brand electronic musical gear. Part of the challenge of doing embedded systems back then was getting the machine code into the actual machine. The C compiler, assembler, and linker generated a binary file, which needed to be physically programmed into multiple EPROM chips in order to run the code on our custom hardware. We actually had software tools to pad out, checksum, and split up the binary data so it could programmed into multiple EPROMs according to our specifications.</p>
<p>And then we started designing systems that exceeded the capabilities of our tools. And I had to hack together custom C programs to reformat the binary data according to the new requirements. I think I might have done that twice. And then I asked myself whether Perl, which was always very good with strings of data—and what is a binary file but a big string of data? I asked myself whether Perl might be able to do a better job.</p>]]></description>
</item>
</channel>
</rss>
