Login  Register

Re: Where does my code spend time and how to improve this

Posted by nyholku on Jan 01, 2019; 8:55pm
URL: https://forum.jogamp.org/Where-does-my-code-spend-time-and-how-to-improve-this-tp4039358p4039361.html

For posterity:

converting to pure int math made no difference in execution time.

But it did introduce a problem: integer overflow!

Originally in the kernel

h = tool[ti] + tool_pos_z;

handled oveflow gracefully when  tool[ti] had Float.MAX_VALUE values
which are used to mark infinite height in the height map.

With integers that obviously not works, not with Integer.MAX_VALUE either
so a different strategy will need to be devised if ints are to be used.

wbr Kusti