Jump to content

An efficient way of storing huge table in a file


vovo4ka

Recommended Posts

I would like to save VERY big lua table into a file. And read back it again.

Now i'm doing it like this:

1. Serialize table into text string with lua syntax

2. Write text string into a file

For table restore I use execution of serialized string, so its restored by self and much more faster than serialization procedure.

All operations are performed by server.

But then table is very large serialization procedure takes a looong time, and exceeds execution time limits.

I have a several questions.

1) Is it possible to store binary data in Lua (I cant find this information)?

2) Is the more efficient way to store table in file exist?

3) Can I write resource module in C++ ( as binary module) with speeded-up serialization?

4) When I'm using co-routines in Lua the new thread is not executes in parallel with main thread. I have implemented suspend-resume mechanism but with it function executes for a several minutes (more than 3 min) and that's not good. So is it possible to increase execution time limits using Lua?

5) Is it possible to later builds of MTA built-in serialization function written in low-level c++ code? There are a lot of implementations of serialization for lua: [urlhttp://lua-users.org/wiki/TableSerialization][/url] Lua versions are too slow. But I can't use c++ for resource.

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...