I think, on a modern processor, a lookup table of 65k is way too big to be worthwhile for something as simple as a division
memory access is relatively very slow; OP probably should have benchmarked it
memory access is relatively very slow; OP probably should have benchmarked it
But I'm also very skeptical that this is actually faster. Would have been nice to see some numbers
but yeah, this is just my speculation
It may clearly state that memoization is slower, until you plop it into a benchmark that inlines division explicitly without using a given hardware accelerate.
division by a constant input can be solved faster still, so there can be optimizations on top of memoization that would beat raw division on most peocessors/runtime environments.