On Thursday, 23 May 2019 at 18:57:03 UTC, Ola Fosheim Grøstad
wrote:
On Wednesday, 22 May 2019 at 00:22:09 UTC, JS wrote:
I am trying to create some fast sin, sinc, and exponential
routines to speed up some code by using tables... but it seems
it's slower than the function itself?!?
Not when I tried it with one of the online compilers, LUT is
3-4 times faster on your tight inner loop, but I guess it
depends on the CPU.
LUT should be very fast in long-running tight inner loops like
that once the cache is warm with such as small LUT that fits in
working memory (cache).
I've used very small LUT's like a length of 5 and it didn't
significantly change anything.
Unless it is being hit hard at the start and that is skewing the
results, it doesn't seem to be the issue.
I haven't tested this well but was just thrown off by the results
as it should easily have been inverted and I expected quite a
significant speed up(several factors) and not the reverse.