View Single Post
11/20/17, 06:58 AM   #4
Solinur
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 78
I might have found a clue.

Shinni pointed out that lua stores each string only once, preventing a duplicate string to be stores again. Maybe its the same with values. This would make it very memory efficient and maybe explain how certain limits come into place. It would probably mean that there is a fixed number of different keys + values (my guess: 131072) a table can have, be it strings or values.

for example:

Lua Code:
  1. function CMX.MakeData(N,N2)
  2.  
  3.     CombatMetricsFightData_Save = {}
  4.    
  5.     for i = 1,N do
  6.        
  7.         CombatMetricsFightData_Save[i] = {}
  8.         local logdata = CombatMetricsFightData_Save[i]
  9.        
  10.         for k = 1, N2 do
  11.  
  12.             logdata[k] = i.."|"..k
  13.        
  14.         end
  15.     end
  16. end

and calling it with N = 131 and N2 = 1000 leads to a corrupted file since numbers 1 to 1000 are used as keys and 131000 strings of type "i|k" are created. This means we have 132000 different elements in use causing it to fail upon recreation from file and starting to address them from the beginning again.

Calling said function with N=130 and N2 = 1000 seems to be fine (would be 131000 different keys+values)

Edit: Just saw that uesp had the same conclusion at the end. Didn't read it in detail as I already had an idea in my mind that I wanted to note down