Schroedingers-Hat/jsphys — comment on commit bca4996b900a21511f241a176e944b79b8cae19b
File:  line 0
By Schroedingers-Hat:

I also just realised that bilinear interpolation is, in fact, bilinear.
As such recalculating the horizontal gradients all the time is completely redundant.
Along with one or two other things (like repeated code where things could be streamlined now that chrome isn't chucking a hissy fit with one extra variable), they don't impact much on the efficiency though. The bulk of the calculation is in the inner loop.