8

Is there a way to find how much size a state (object, array, etc) or a component occupies in memory.

In my current context, I need that to know if a specific state/component is very heavy (in term of memory).

In chrome, I already tried to snapshot the memory, but I couldn't find how to identify a specific component or state in the result in such large info like this:

enter image description here

4givN
  • 2,936
  • 2
  • 22
  • 51

1 Answers1

1

For variables size you can find it using this js function and then use console logs or using google chrome developer tools

For component size check Linus response.

LastM4N
  • 1,890
  • 1
  • 16
  • 22
  • Thanks for answering but according to his answer `Quick & Dirty I would write something unique into the component’s data and search for that string.` , I will need to make too many manual changes then rollback. Not very interesting – 4givN Jan 26 '21 at 21:07