1
0

DebugTools.js 595 B

1234567891011121314151617
  1. setup.variableStorageUsage = ()=>{
  2. let result = {};
  3. for(const [key,v] of Object.entries(State.variables)){
  4. if(!key.startsWith("QSPVAR"))
  5. continue;
  6. if(key.endsWith("_indexDict"))
  7. continue;
  8. let storageUsage = JSON.stringify(v).length;
  9. const idOfDict = key+"_indexDict";
  10. if(State.variables[idOfDict])
  11. storageUsage = JSON.stringify(State.variables[idOfDict]).length;
  12. result[key] = storageUsage;
  13. }
  14. result = Object.fromEntries(Object.entries(result).toSorted((a,b)=>b[1]-a[1]));
  15. return result;
  16. }