TrickJarrett.com

Friday, February 12th, 2021

« Previous Day Next Day »

A Raspberry Pi Cluster vs. Macbook


This video is neat because the code he uses to test the performance ends up being a fairly simple script that looks for prime numbers. This was hugely nostalgic for me as, in high school, I had a coding challenge with a buddy of mine named Josh to do this. We wrote code to find the primes between 1 and 1,000,000. But ours wasn't about processing power so much as optimized code.

My big realization, which seems so obvious looking back, was that I only needed to check a number up to it's square root for factors. So if I have the number 81, I don't need to look past 9. If there are no factors for 81 below 9, then it is a prime number. Obviously, 81 is not prime, it's a perfect square.

I also have a love for cluster Raspberry Pi projects and still have idle plans to build my own cluster one day. The only reason I haven't is that I don't have any need at all for it. The closest I've come is the idea of running this blog on a raspberry pi cluster out of my house, but that also comes with a number of headaches and challenges. Maybe one day.

2/12/2021 2:41 pm | | Tags: raspberry pi, programming
« Previous Day Next Day »