Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Optimization sine/cosine functions. #304
I have still not benchmarked this to see if it works well in practice. The large lookup tables could blow up the CPU cache. Sometimes it's better to recompute instead of waiting for memory loads.
The precision of the sine/cosine functions is not super important, so it does not matter if they compute the most precise value, and it would be nice to replace the Apache math library. On the other hand it is generally not a good idea to maintain your own math functions - better to leave that to a well tested library.
I tried to manually merge this pull request, but can't download the patch from GitHub:
The FastMath class is used in many more places in Chunky now than when this pull request was created, and not only the sine and cosine functions are used -
Please feel free to make a new pull request with the changes based on the current version of Chunky. I will make sure to benchmark it quickly if you create a new pull request, so that it doesn't take years to resolve the pull request as in this case.