 Hey, hi everybody. This is my third preview video for my Space Arena game So I want to show you where the games at but also I want to talk to you about a problem I've been having with performance and how I kind of sussed out where that was it's kind of interesting and I actually want to compare Mac OS X to Windows to Linux and kind of see where the performance is best For the Python turtle module, so let me go ahead and show you where the game is right now Okay, so I've added a little sidebar here. I've made the play area here now up here You'll see I have a little frames per second running Each seconds updated so you can see I'm getting about 14 15 16 frames per second Which is obviously far too slow. That's kind of fun to watch watch it in slow motion. Don't get me wrong But yeah, it's not not running as I would like so You know, I thought that what was going on was that I just the game. It just becomes you complex The turtle module just wasn't capable of displaying the graphics that I need. I was thinking about okay This is this is the time to bite the bullet and go use pie charm. Get that guy But here's what I discovered so taking a look over here you can see there's some flashing here with the text So that's kind of a clue, but what I did was I Enabled the radar what one of the things I tried to do was okay I'll make the radar only on the screen sometimes because I figured that rendering the radar would really slow the game down So let's take a look. I'm gonna go ahead and switch from this little text thing To the radar and watch what happens with the frames per second It's now I've got this cool little radar display and my frames per second per second have actually gone up From fifth around 15 to around 20 Which was totally totally counterintuitive. I had totally assumed that of course Rendering something this complicated extra graphics was going to take a lot more processing power But as it turns out it didn't so it kind of gave me a clue as to where the issue was at so let me close that and Make a couple changes here So it kind of dawned on me after seeing that that writing text on the screen is a very slow operation, so I'm just going to comment these lines out and I'm going to hide all the text on the screen and see basically what happens oops and see what happens to my Program see what the speed difference is. I'm gonna go ahead and run it again. So all of the pen dot write Lines have been comped it out. There's four of them. So let's go ahead and hit f5 and see where we're at with frames. Oh My gosh, so we have jumped up to 47 49 almost 50 frames a second Earlier I had 60 but it's probably running a little slowly because I'm doing a screen recording now And but now the game is actually a lot more fun as things are bouncing around and there's you can see things It'll start flying around a little bit faster Oops, I don't want to destroy my power up and now let me go ahead and turn the radar on and see how that affects the frames per second And you see wow it's actually gone up Which was certainly not expected. Okay now it's back down So interestingly enough you can see here all the graphics that I'm rendering all these enemies and everything It's on the screen It's not such a big deal. You can see the background stars You can see the enemies you see the power-ups the explosions All those things. Let me go ahead and try and show you just it really doesn't affect the frames per second that much now again Without the recording the screen. I was getting about 60 frames per second at this point So this tells me that I really need to Reconsider using text in this game. So I have to think about how am I going to Show Numerical information how many enemies are left? How am I going to show the score? What are my options there? I haven't figured that out yet. I'm still thinking about it now on a side note I decided to test this on a couple different computers now my MacBook here that I'm running this on this is a MacBook Pro 13 inch my school provided it to me I did not buy it. I would not spend that much money on a computer to be honest You can get these now about about 1200 bucks us This is a bit of an older model now That's two three years old something like that and it's supposed to be pretty top of the line But you can see I was getting almost 60 frames a second there Pretty expensive computer pretty high-end I'll talk about the specs in a minute. And so what I did was I took this code and I ran it on a crappy really crappy netbook and So you can see it's basically a 11 inch mouse computer. It's this local Japanese brand of Yeah, laptop and they're they're cheap So this thing has a Celeron processor and compared to my MacBook Pro it has less memory Much slower clock speed no clock speeds not everything of course MacBook Pro is an i5 And I also ran it on my ace Zen book, which is an i5 1.6 gigahertz clock speed 8 gigs of RAM and Intel processor, but interestingly enough the difference between these systems is the operating system So we got Mac of course in the MacBook Windows on the mouse computer and Linux on my Zen book because that's what I run personally and you can see here are the numbers so the original code with the text this low-end Mac book or not sorry is low-end a laptop practically a netbook actually beat Mac OS X and the Linux Hands down by about 10 frames a second When I engage the radar the difference wasn't quite as big But you can still see that the Mac is is really struggling with the text so here There's still a little bit of text rendered So Windows shot up 30 frames a second, which is still 50 percent faster and Linux was around 27 So very similar performance there now once we get rid of all the text That's where we start to see some serious differences So the Mac you know to its credit finally with no text shot up to 60 frames a second The Windows computer again Celeron 1.1 gigahertz Only went up to 33 but for this you know pretty old It's actually several years old and very low-end spec computer. That's some respectable numbers now Linux Of course unsurprisingly is the champion 130 frames per second with no text and with the radar rendering and With no radar you can see the difference here Linux. I got up to 240 It was peeking out at some crazy number like 260, but it was are averaging around 240 220 something like that now Windows again respectable performance for a very small Very low cost very low-powered computer and again the Mac the Mac implementation of the turtle module is just clearly Slower, I don't know if it's a developer thing I don't know if it's a Mac thing, but you can see here that Despite costing twice as much as this computer Well, maybe about 50% more maybe but when it came out probably a few years ago It's probably about twice as much. I got this I think for around 700 800 bucks on on Amazon And the Windows computer is probably a few hundred dollars. I don't remember I didn't buy as my wife's computer actually and You can see here. It really holds its own so you know respect to the Windows developers and Respect to whoever maintains the Windows port of the Python turtle module. You guys have done a great job So I don't know who gets the credit, but you deserve it for again such a Low-spec computer you can see the charts here how Mac goes up here Windows has a strong performance here strong performance here, and then of course once the text is gone the superior you know specs of the computer really really takes over and interestingly comparing Linux and Mac which are both Unix based operating systems. You can just see that Linux just far far outperforms Mac So it should come as no surprise that I am a dedicated Very happy Linux user. I use Mac because that's what my work provides. That's what my students use So anyway, I thought it was kind of interesting. I thought I'd share that with you how I Yeah, I ran into a problem how I sorted it out figured out what where the issues were again I don't know how I'm going to move forward with this what I'm gonna do yet about displaying the score data But I'm gonna give it some thought between now and the time I finish the program Hopefully I will have an answer for you that will satisfy everybody's needs Anyway, stay tuned for updates hit the subscribe button if you haven't done so already. This is a wild ride I'm very excited. I'm even more excited to say about this program. So thanks for tuning in everybody. Take care