From: Chuck Brotman Date: 2005-07-14T03:19:06+09:00 Subject: Re: Updating GUIs "Martin DeMello" wrote in message news:jQ4Be.1947450$Xk.771377@pd7tw3no... > Joe Van Dyk wrote: >> >> Oh! That's a great idea. I understand now. The cost of that is that >> I need 72 times more memory for the TkcPolygons, right? Which >> probably isn't too significant. > > If it is, a halfway measure is to precompute the sines and cosines of > angles in five degree increments, and get them from the lookup table > instead. > > martin > > I agree with john's post. I'm no expert on the object oriented aspects of performance (object creation, etc), but I'll try to help from a purely "functional standpoint. It's Hard to tell what your bottleneck is, without seeing a performance profile. but, from my experience (with c++) the transcendental functions (sin, cos, etc)take a significantly amount of computation! Caching pre-calculated results for polygon rotation or even just the sin/cos functions can make an order of magnitude difference, and don't really take up that much space. (I did it for 1-degree increments and had no problems. Also, even in a faster language, like C++, you may need to be careful of unintended integer/float conversions, especially in the middle of functions. If you can get everything in terms of integers you can get much improvement.