Fast Modulo help needed

gvi70000:
i have also other functions on the run i want to save speed and memory

So how about addressing the 99.97% of the CPU load that is not caused by this code fragment? Fixing a flawed algorithm will yield far greater benefits than optimising small parts of your code - especially if you're focusing on parts that only contribute to 0.03% of the load. Suppose you manage to reduce that to 0.02% - has that solved your performance problem?