From: Daniel Brockman Date: 2005-07-13T11:49:05+09:00 Subject: Re: Updating GUIs Joe Van Dyk writes: > This is taking me about a third of a second to do. Seems a bit high > if I want to do this at least twice a second and leave room on the > machine to do other things: [...] > player.polygon = player.polygon.collect do |x,y| How about this? player.polygon.collect! do |x,y| > So what's the next step when trying to optimize this? Convert the > rotate function to C? Or can I use a different algorithm? I didn't look at your algorithm, but before starting to convert stuff into C, I'd try eliminating the extra object creation. I don't know how much time it'll buy you, but maybe even try making `rotate' destructively change the array instead of returning a new one. Actually, I haven't done any optimizing of Ruby code, so I'm mostly talking out of my ass. But I think it's worth a try. -- Daniel Brockman So really, we all have to ask ourselves: Am I waiting for RMS to do this? --TTN.