SphereCommunity
Size of data types - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: General Help (/Forum-General-Help)
+--- Thread: Size of data types (/Thread-Size-of-data-types)



Size of data types - Monty - 01-07-2014 05:21 AM

Hi guys,
can somebody tell me how much memory takes vars,tags or list? What is better to use?

Is it takes same memory tag.test = "blabla" like this tag.test = "blablablbabl ablablbabla blablbablablablb ablablablbablablablba blablablba blablablba" ?

And is better to use SQLite to store data or not?

Like everytime sorry for my bad english and thx for answer.


RE: Size of data types - Wap - 01-07-2014 05:45 AM

(01-07-2014 05:21 AM)Monty Wrote:  Is it takes same memory tag.test = "blabla" like this tag.test = "blablablbabl ablablbabla blablbablablablb ablablablbablablablba blablablba blablablba" ?
No.

(01-07-2014 05:21 AM)Monty Wrote:  Hi guys,
can somebody tell me how much memory takes vars,tags or list? What is better to use?
As I remember(if nothing was changed), 1 symbol in string-type TAGs = 1 byte. But number-type TAG weight = 4 bytes.


RE: Size of data types - Alaric - 01-07-2014 05:48 AM

I'll try a quick answer. Correct me if I'm wrong.
If the tag/var/whatever contains only numbers its stored as a number.
If it contains some chars - comma, question mark, anything from alphabet, etc. It's stored in some shitty coding. Unicode, UTF8,16,32. In this case it should be common ASCII. So, 2 bytes(7 or 8bits) per char.

Logically, more letters means more memory. Even tags itself "shouldn't be" named like tag.the_most_awesome_person_in_the_world="me" but tag.bestperson="me".

Shorter = better but it must be understandable.