Brainstorming: Noise optimization
#38
I had a Heureka moment last night. If I remember correctly, it is possible to templatize functions not only on type, but also on an integer value, right? This might make the cCubicNoise::GenerateX() functions faster - if they had the array dimensions as template parameters, rather than regular parameters, the compiler would be able to make much more optimizations, such as unrolling the loop and perhaps even vectorizing the calculation, if it's smart enough. We're using a small set of dimensions anyway - usually only a 5x5 array.

It might be interesting to implement at least a 2D generator in this way and compare its performance with the current approach, whether we get any substantial difference on, let's say, a million 5x5 arrays generated. The NoiseTest project should be able to measure this, when modified.

Another set of functions quite likely to benefit from such an optimization would be the the linear upscaling functions ($/src/LinearUpscale.h), used heavily in the generator. Again, a test confirming this would be nice, and it doesn't require the tiresome decoupling.
Reply
Thanks given by:


Messages In This Thread
Brainstorming: Noise optimization - by xoft - 03-28-2013, 05:54 AM
RE: Brainstorming: Noise optimization - by xoft - 03-28-2013, 07:29 AM
RE: Brainstorming: Noise optimization - by ThuGie - 01-15-2014, 10:29 AM
RE: Brainstorming: Noise optimization - by xoft - 01-15-2014, 10:56 PM
RE: Brainstorming: Noise optimization - by xoft - 01-16-2014, 06:18 AM
RE: Brainstorming: Noise optimization - by xoft - 01-17-2014, 05:06 AM
RE: Brainstorming: Noise optimization - by ThuGie - 01-17-2014, 07:17 AM
RE: Brainstorming: Noise optimization - by xoft - 01-18-2014, 08:13 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 01:02 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 01:20 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 01:45 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 02:05 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 07:29 AM
RE: Brainstorming: Noise optimization - by xoft - 01-19-2014, 05:14 PM
RE: Brainstorming: Noise optimization - by xoft - 01-24-2014, 06:37 PM



Users browsing this thread: 3 Guest(s)