What E.getSizeOf actually return? #1677
Unanswered
espruino-discuss
asked this question in
JavaScript
Replies: 1 comment
-
Posted at 2023-07-12 by @gfwilliams This might be some help: http://www.espruino.com/Performance#every-datatype-in-espruino-is-based-on-a-single-storage-unit-12-16-bytes- But as you spotted, blocksize is 14, so each block is 14 bytes. So Other examples:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2023-07-11 by Nicktonious
Reference page says that "E.getSizeOf() returns the number of variable blocks used by the supplied variable".
But how should I estimate the real size of entities in my app? For example, E.getSizeOf(Number.MAX_VALUE) returns 1, meanwhile the bocksize is 14 (according to process.memory) and espruino numbers are 64bit. It just makes no sense for me.
Sorry for asking kind of stupid question, but I really want to figure out how to calculate size of objects as preciese as possible. Thanks for answer in advance!
Beta Was this translation helpful? Give feedback.
All reactions