vovo4ka Posted June 18, 2012 Share Posted June 18, 2012 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
TAPL Posted June 18, 2012 Share Posted June 18, 2012 i think db is what you need. https://wiki.multitheftauto.com/wiki/Ser ... _functions more info here viewtopic.php?f=148&t=38203 Link to comment
vovo4ka Posted June 18, 2012 Author Share Posted June 18, 2012 Thx for reply! No database is not suitable for me, because data is not aligned well (its not a table actually). Also it needs to frequently offline copy to another pc. Link to comment
DiSaMe Posted June 18, 2012 Share Posted June 18, 2012 I think I could try making functions to read to and write from binary files efficiently because I need them too, but I have to do something else first. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now