kicad-developers team mailing list archive
Mailing list archive
Re: Trigonometric look up table.
Dick Hollenbeck <dick@xxxxxxxxxxx>
Mon, 19 Sep 2011 14:39:10 -0500
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:18.104.22.168) Gecko/20110831 Thunderbird/3.1.13
On 09/19/2011 02:00 PM, Kerusey Karyu wrote:
> Dnia 2011-09-19, pon o godzinie 11:15 -0400, Wayne Stambaugh pisze:
>> Is there any logical reason to keep using the trigonometric look up tables in
>> trigo.cpp? We currently have a mixed bag of using the look up tables and the
>> math sin() and cos() functions in various code paths. If no one objects, I
>> think it's time to remove them from Kicad.
> I'm not familiar with a KiCAD source, but I think the lookup tables
> should stay. Why? In some cases a lookup will be faster than math
> functions. I don't know, but while redrawing - an arc for example -
> these tables speed-up a lot the screen refreshing.
> Kerusey Karyu
Do you have approximate benchmarks?
I vaguely remember that on a modern day desktop machine, say Intel, that the sin()
function took only about 12 clock cycles nowadays. This is because of the high end FPUs
I am not sure about this, and do not have time to research it.