Jump to content

Storing large text items in XML or Lua tables?


bradio10

Recommended Posts

Hi,

I have made a system so I can have multi language support and I currently have all the logic for translations in Lua tables, but I was wanting to know if it would be better to have all the tables in XML?

Would XML be more faster and more efficient than having them in Lua tables or would it not really matter?

Thanks.

Link to comment

Tables are pretty efficient, for example I made a parser which reads a file that has thousands of lines of text.

I then loop through this table, splitting each individual line into different parts to make it easier to use the data and store it in a new table.

All in all, the whole process takes around 6ms for over 1500 lines. That includes the entire process.

Read the file -> Store each line in a table -> Loop through the table, split the strings into parts -> Store into a new table

Link to comment
Hi,

I have made a system so I can have multi language support and I currently have all the logic for translations in Lua tables, but I was wanting to know if it would be better to have all the tables in XML?

Would XML be more faster and more efficient than having them in Lua tables or would it not really matter?

Thanks.

Marked

Link to comment
xml would make server lag if a lot of things are inside

a simple file would do fine in my opinion. [ you can e.g make a table and when u want to save a table to file use toJSON and save it, and when loading it use fromJSON ]

This myth that XML will magically lag the server needs to end. It doesn't, unless you use it incorrectly, like anything else.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...