Last week in some thread there was a discussion that involved jsonData. So I tried it and I was positively surprised by it's memory gains!
My static code looked like:
typedef ValueType as Numeric or Time.Duration or String or Null or Array<Numeric or Time.Duration or String>; const DATA = [/*lots of data*/] as Array<ValueType>;
Then I changed it by removing the data from the code and added it as jsonData:
<resources> <jsonData id="data" filename="data.json"></jsonData> </resources> var DATA as Array<ValueType> = [] as Array<ValueType>; DATA = Application.loadResource(Rez.JsonData.data) as Array<ValueType>;
And I looked in the memory viewer in both cases.
There's a gain in: code size (obvious), but also in data size (surprising), and most importantly in peak memory. However the most surprising is that even the globals.DATA size shrinked, even though the data looks the same. Some of the elements became smaller when loaded via loadResource.