Re: Saving/Loading big map table
Posted: Tue May 22, 2018 3:29 pm
Thx for the tip, i will try to rewrite my code for it to work with 1d arraygrump wrote: ↑Tue May 22, 2018 2:37 pm Yes. Although using a table of tables is not the most efficient way to do this, it will work fine.
For maximum effciency use a plain, one-dimensional array and index like this:That's not Blob related though, just general performance advice. You'll get better cache hit rates when you do it like this.Code: Select all
local map = {} for y = 0, 2047 do for x = 1, 8192 do map[y * 8192 + x] = blob:readU8() end end