Minimal JS Memory using JSON or Dict?
Jan 27 2015 | 4:49 pm
Having gotten to know JS for the past year and doing a few projects I'm starting to notice speed and memory issues and have started looking for the best methods for efficiency. I've seen info about garbage collection and freepeer but I have a basic question I'd like expert input from.
I'm gathering clip info from the LiveAPI; each clip is an object with about 8 keys and each object gets pushed into an array. Each clip object gets created the first time the clip is selected (I don't poll all clips during init). The array of objects grows and after awhgile Live starts visually freezing when a clip is selected.
What I would like to do is keep the whole array in JSON or dict form instead, in a file if I have ton and then just only query it and pull the object to free up memory. Does this work?
Or is just having a dict better even though it's still memory? Is there a difference holding info in a dict than in js?
I'm still going to see what happens but am hoping a more informed answer will be better than finding out in the dark. I really just want to only have one clip info in memory but have all the gathered info where it isn't in memory.