<div dir="ltr"><div>Hi been working thru the How to Design Programs book with a meetup here in St Louis.</div><div><br></div><div>Just finished writing a pong game and though the performance is acceptable on a normal laptop I was a little surprised how poorly it runs on a raspberry pi...</div><div><br></div><div>Not that I'm that worried about the pi, but it started me looking a little closer at performance and wondering if I've written things in a way that hurts performance.</div><div><br></div><div>The first thing I noticed is cpu usage was high even when nothing was happening in the game (e.g. when the pong game was just idling and there was no movement on the screen at all).</div><div><br></div><div>In fact I noticed on my MacBook the program sits on 100% cpu all the time!</div><div><br></div><div>But on my little ubuntu netbook (chromebook running ubuntu) the same program sits at about 30% cpu.</div><div><br></div><div>And on a Windows 8.1 laptop it's only taking 6% cpu.</div><div><br></div><div>These numbers are when running with command line racket not thru drracket btw.</div><div><br></div><div>One thing I can see is that on-draw is called for every on-tick on all three platforms btw.</div><div><br></div><div>And even in cases where the program is idling and on-tick has simply returned the world state it was given unmodified.  </div><div><br></div><div>Is that normal I wonder?  Part of me thought that since to-draw is a function of the world state, and the world state hasn't changed, that it would *not* call to-draw in that case.</div><div><br></div><div>(but it calls to-draw for every on-tick even on the Windows machine which is using only 6% cpu - so maybe I'm wrong to look to that as the problem)</div><div><br></div><div>Could it be on Windows the graphics drawing is GPU accelerated but on the Mac it's not?  i.e. maybe on the Mac all drawing done with the CPU alone?</div><div><br></div><div>Or could this be an actual bug in racket I wonder?</div><div><br></div><div>Lastly - and again it's not a big deal I'm just curious - do people think a program like this should be able to run with racket on the Pi?  Or is the Pi too underpowered for universe programs with racket?</div><div><br></div><div>Thanks,</div><div><br></div><div>Darren</div></div>