Updated perf-max

There was a high difference in execution times basically because LuaJIT
was hoisting the calculation of max out of the loop and max was not
being called within the loop.

Using the computed value forces LuaJIT not to hoisted out of the loop.