• Re: Strings

    A string takes 1 jsvar per 12 characters.

    A simple array takes 2 jsvars per elements in the array, plus each of the elements has to be stored.
    Since your keys are ~6 chars long, you're taking 3 jsvars per key, vs ~7/12ths of a jsvar for storing them as a big string.

    Large simple arrays are very inefficient in Espruino.

  • @DrAzzy, this explains why I ran out of memory... but how do you explain that after adding even more logical strings (keys) in less physical strings, but then storing them back with the old format - 1 key per element - out of memory condition was avoided? The explanation would be: A string takes 1 jsvar per 12 characters in the source code. Does that sound right?

About

Avatar for allObjects @allObjects started