I can remember doing some optimization in Java way back (~2001 or so) where doing this kind of thing actually made a huge difference due to locality of reference - basically allocating a huge byte array and working with that to implement an &quot;inner&quot; hash-table rather than the usual structure that used, at least back then.