Tables, Memory and Size

This is just a general question about how much size a table can have in luau and its impact on performance, as I heavily rely on tables, performance hits me, so curious of me would having a big table handle all objects deter performance, or multiple tables for each?
Speaking of sizes, how much memory does each object take up. (e.g strings, tables, instances)

Tables can hold at least a million objects and are only slightly bigger than the size of all the items they hold. How much memory an instance uses is likely extremely complicated but can be estimated by just making a bunch of them and seeing what happens.

1 Like

If you’re extremely curious, then you should take some CS50 videos and apply it to a LuaU code when it’s compiled. You don’t have to worry about and shouldn’t worry about tables being too much for the most part.

In my sense (when compiled), a table begins at a certain point in the memory depending on the current system. It can extend up to as much.

If you are talking about actual object addresses like game.blahblah in tables/vars, I believe they’re like pointers (???)

Strings in general are just group of characters (but a string can have only one character).

I believe tables in memory are simply just begin and end with other bytes between it.

I can confirm it’s set up in a procedural way and not interlace or stuff like that (Roblox handles all of it), so you shouldn’t worry about the mystery factors of using tables. It also varies not going to lie, so really the answer is abstract. I have flaws, so don’t trust most of the BS I say even though I’m trying to be helpful on giving you an idea.

1 Like

I remember seeing a particular image in here stating each object memory, with table being bytes, but I sadly lost it and the highest object using most memory is apparently Color3, I just needed confirmation to how much bytes a table can get to depending on its structure and if dictionaries in it also affect it.

1 Like

Managed to find that’s detailing every size a table entry has.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.