Quote Originally Posted by Nitrogen
I cant think of any situation where a power of 2 calculation is not fast enough...
I've used this in Perlin noise in real-time. If you can't think on some situation, it doesn't mean that such situation doesn't exist.

Quote Originally Posted by cairnswm
Now this is how to do it with a lookup table
You'd extend this method up to High(Integer), instead of 2048. You never know.

Quote Originally Posted by Nitrogen
2nd place was Lifepower's NextPowerOfTwo() at 18.80ms
(which returns the next highest power if given a power, so 1024 returns 2048...)
Have you checked CeilPowerOfTwo? Would be interesting to compare the two.

Quote Originally Posted by Paizo
with recent compilers improvements do you think that assembler is still faster?
I mean that compilers can improve execution speed on differents architectures (ie amd,intel...), assembly can't be optimized by compiler (i think). just for know what you think about
This argument is common these days, especially in MSDN documentation, where they explain that we don't need assembler on 64-bit systems anymore. Ironical though, their own JIT doesn't optimize much of the code on the fly "to increase startup speed".

Compiler will do a better optimization job than a human, when it will be able to write code instead of yourself (pro genetic programming? ), but then it won't be a compiler, would it? Until then, humans will still be able to perform the task better.

Quote Originally Posted by Nitrogen
I should also point out that most games these days are using up to 2048x2048 textures so you actually need a massive 8.4kb of memory...
...then I guess the game will only be able to have 16 different textures on my 256 Mb video card. :cry: