<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Day 4 &#8211; Having Fun with Rakudo and Project Euler</title>
	<atom:link href="http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/</link>
	<description>Something cool about Perl 6 every day</description>
	<lastBuildDate>Sun, 03 Feb 2013 05:15:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Tim Bollman</title>
		<link>http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/#comment-1373</link>
		<dc:creator><![CDATA[Tim Bollman]]></dc:creator>
		<pubDate>Tue, 04 Dec 2012 16:03:18 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=1164#comment-1373</guid>
		<description><![CDATA[I agree completely that your solution was the right one to put in the post, native call is important to show off, it&#039;s a cool feature.

Not surprised on the lack of result for N=4, performing a linear extrapolation of the comparisons on the 1.7 seconds leads to about 10 hours. (41,314 for N=3 vs. 880,972,037 comparisons for N=4).

I created a priority queue based version last night, but I tickled Rakudo the wrong way with my implementation and it was very slow (heaps are pretty simple, they pretty much just need push, pop, and swap to be fairly fast operations on the list type). It may still end up faster for N=4 because 10 hours is not a hard time to beat, but N=3 was about 5-10 times slower using it. I&#039;ll see if I can get it running faster, perl 6 should have a priority queue module implemented for it anyways, so it will be good to have either way.]]></description>
		<content:encoded><![CDATA[<p>I agree completely that your solution was the right one to put in the post, native call is important to show off, it&#8217;s a cool feature.</p>
<p>Not surprised on the lack of result for N=4, performing a linear extrapolation of the comparisons on the 1.7 seconds leads to about 10 hours. (41,314 for N=3 vs. 880,972,037 comparisons for N=4).</p>
<p>I created a priority queue based version last night, but I tickled Rakudo the wrong way with my implementation and it was very slow (heaps are pretty simple, they pretty much just need push, pop, and swap to be fairly fast operations on the list type). It may still end up faster for N=4 because 10 hours is not a hard time to beat, but N=3 was about 5-10 times slower using it. I&#8217;ll see if I can get it running faster, perl 6 should have a priority queue module implemented for it anyways, so it will be good to have either way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gerdr</title>
		<link>http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/#comment-1367</link>
		<dc:creator><![CDATA[gerdr]]></dc:creator>
		<pubDate>Tue, 04 Dec 2012 08:18:42 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=1164#comment-1367</guid>
		<description><![CDATA[Very nice. I actually thought about looking into a sieve-of-Eratosthenes-like solution when writing the article, but decided against it as having an example of what to do when all else fails seemed like a good idea.

Anyway, I ran your algorithm on my machine and it clocks in at 1.7s for N=3. For N=4, I stopped the run after ~40m without result.

If you have a github account, feel free to add your code to the repository - as-is or after making the suggested improvements.]]></description>
		<content:encoded><![CDATA[<p>Very nice. I actually thought about looking into a sieve-of-Eratosthenes-like solution when writing the article, but decided against it as having an example of what to do when all else fails seemed like a good idea.</p>
<p>Anyway, I ran your algorithm on my machine and it clocks in at 1.7s for N=3. For N=4, I stopped the run after ~40m without result.</p>
<p>If you have a github account, feel free to add your code to the repository &#8211; as-is or after making the suggested improvements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Bollman</title>
		<link>http://perl6advent.wordpress.com/2012/12/04/day-4-having-fun-with-rakudo-and-project-euler/#comment-1365</link>
		<dc:creator><![CDATA[Tim Bollman]]></dc:creator>
		<pubDate>Tue, 04 Dec 2012 04:44:26 +0000</pubDate>
		<guid isPermaLink="false">http://perl6advent.wordpress.com/?p=1164#comment-1365</guid>
		<description><![CDATA[You can probably get a fast enough problem 47 using pure perl6 (though you&#039;d need a priority queue to do it).

Like anything, you flip the problem onto it&#039;s head. Instead of factoring the number, you work from the fact you are going through these numbers in sequence and essentially write a sieve of Eratosthenes that keeps track of how many primes cross out a number.

Slow version that uses a list instead of a priority queue is https://gist.github.com/4200603

(The essential difference with the priority queue is that you pop off all the items with key == $_, then push them back on with the updated number).

To reduce churn in the data structure, you&#039;d probably also want to just keep 2 and 3 as separate counters because they come up so often.

I have a very old version of perl6 at work, so I can&#039;t really give you speed numbers. But the c version of the same algorithm is in the less than a second category for N = 4, even without a priority queue.]]></description>
		<content:encoded><![CDATA[<p>You can probably get a fast enough problem 47 using pure perl6 (though you&#8217;d need a priority queue to do it).</p>
<p>Like anything, you flip the problem onto it&#8217;s head. Instead of factoring the number, you work from the fact you are going through these numbers in sequence and essentially write a sieve of Eratosthenes that keeps track of how many primes cross out a number.</p>
<p>Slow version that uses a list instead of a priority queue is <a href="https://gist.github.com/4200603" rel="nofollow">https://gist.github.com/4200603</a></p>
<p>(The essential difference with the priority queue is that you pop off all the items with key == $_, then push them back on with the updated number).</p>
<p>To reduce churn in the data structure, you&#8217;d probably also want to just keep 2 and 3 as separate counters because they come up so often.</p>
<p>I have a very old version of perl6 at work, so I can&#8217;t really give you speed numbers. But the c version of the same algorithm is in the less than a second category for N = 4, even without a priority queue.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
