Tables performance question

Hi there!, i’m wondering if it’s better to have less tables with more entries or more tables with less entries, in other words, what would be better:

Table #1: entry#1, entry#2, entry#3
Table #2: entry#1, entry#2, entry#3
Table #3: entry#1, entry#2, entry#3

OR

Table #1: entry #1, entry #2, entry #3, entry #4, entry #5, entry #6, entry #7, entry #8, entry #9

I’m starting to have soo many tables because usability+readability but i don’t want to crush performance, so i could merge some of them.
Logic tells me = less tables = better.

But i’d like to know your opinion.

Thanks!

I can’t see there being a noticeable difference. It really depends how you are getting the entries. In theory having a single table would mean we only need to load one but once it’s loaded then there’s not much difference between having 1 and 100. We use a dictionary lookup for the table and then the entry which should be fine for a large number of entries. Memory wise each table has an overhead (150~ bytes I think) due to it being a scriptable object but this is tiny compared to everything else in a game.
So I would say go with whatever is easiest to organise and manage rather than what you think will give better performance. As always try the profiler and see for yourself if there’s any real difference.

1 Like

I see, the truth is that in general the game loads pretty fast, i’m curently preloading all tables in the game start to make sure they’re ready to go anywhere, most LocalizedStrings are assigned to the scripts via inspector to avoid typos in the code, so thanks for the reply!
You do a great work like always, enjoy your weekend boss!:smile:

1 Like

Based on my experience, when the there are too many entries on a single table, localization table window will be having a hard time rendering and opening.
as an example, i had this 8000 localization entry in single table and it took about 15 mintutes to open the window.
so I guess it depends on the number of entries.

1 Like

Wow no i’m having like 50 max per table, i’m better splitting everything into more categories, but i’m not making any game with too much dialog that’s true.

Hi this is a known issue. We have plans to improve the table editor performance.
Are you able to file a bug report? It would be good to have a real example to compare against.