More efficient

Having local variables that are references to tables are far more efficient than just using indices. i. e.

This:
thing[x][y][z][1] = thing1
thing[x][y][z][2] = thing2
thing[x][y][z][3] = thing3

Is slower than this:
local things = thing[x][y][z]
things[1] = thing1
things[2] = thing2
things[3] = thing3