Efficient object properties

I have an implementation of a tileset using SDL3 and the Tiled API. I’m using the properties API to implement properties. The tileset and individual tiles (and objects and lots of other things) can have their own properties.

The two options I can see are to create a separate property table for each object (which may be empty) or a single table for everything, but adding information in the key (eg “tileset.2.tile.14.property.name”.) Which would be preferable, performance-wise, or does it matter either way? Is there any downside (other than having more allocations) to having a lot of small property tables?

Wait, we don’t even know what programming language you are using. From your description alone I can’t tell whether you are comfortable using pointers, or if they are even supported by your chosen language. It helps to show example code of how you think it should work and we can tell you if we know a better way or not. It will fill in so many of the blanks and open up doors for how we can help.
Please don’t make us guess so much.

If you are able to implement asset sharing then you can avoid a massive amount of reallocation for similar objects (see Nystrum’s flyweight chapter).

Sorry. I’m using Lua/LuaJIT. I didn’t mention that because my question was specifically about SDL’s property API. My options are to use a single large shared property id for objects and sub-objects (example - a tileset and tiles) or to create a new property table for each object. I would prefer to use multiple tables but that might result in hundreds of tables.

Seems like using an entity component system would be more efficient.