Is this memory efficient enough?

i want to make sure that this is efficient enough in memory. i want the nested table “can” to exist just to make things easier to access, but i am unsure of whether or not it is extremely necessary. overall, i would also like feedback on if i could change other parts of the table, too.


service.library = {
	block = {
		name = "Block",
		id = 1,
		max = 9999,
		
		model = replicatedStorage.Models.Items.Block,
		
		tags = {
			"blocks"
		},
		
		can = {
			dup = true,
			move = true,
			rot = true,
			scale = true,
		},
	},
}

return service

Assuming that this is just an entry for some kind of registry (the building menu), I don’t think memory optimization matters that much. Might be overkill to even consider it. It only matters for things that can have upwards of thousands or even millions of different versions.

P.S. tags could also be turned into a hashmap just like can if that means making it easier to access.

3 Likes

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