What's the fastest way?

When this function occurs my program slows down dramatically for a few seconds

I need in detail the fastest way to save and load this data please.

saveLocalData(UserID..UniqueID..ChapterID.."Photos", #Album)
    for i,v in pairs(Album) do
        if v.edit == false then do return end end
        j = "Documents:PhotoImage"..tostring(i)..UserID..UniqueID..ChapterID
        saveLocalData(UserID..UniqueID..ChapterID.."PhotoX"..i, v.x)
        saveLocalData(UserID..UniqueID..ChapterID.."PhotoY"..i, v.y)
        saveLocalData(UserID..UniqueID..ChapterID.."PhotoW"..i, v.w)
        saveLocalData(UserID..UniqueID..ChapterID.."PhotoH"..i, v.h)
        saveLocalData(UserID..UniqueID..ChapterID.."PhotoMode"..i, v.mode)
        saveImage(j, v.img)
        v.edit = false

You were told what the fastest way was on the other thread.


Please go back and read that. Please don’t open more than one thread on the same topic (eg saveLocalData)

I’m not sure what do return end is doing as opposed to just return. Another thing is to save v.x, v.y, v.w, v.h, and v.mode in 1 saveLocalData instead of 5.