lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


----- Original Message -----
From: Rob Kendrick
Date: 3/2/2010 10:47 AM
Is binary data important to me?  Based on the numbers above, you bet
it is.
I would suggest you need a different file format for such large-scale
data :)
Why would you suggest that? Lua loads all of that data from the binary Lua in 0.07 seconds. Any other key/value pair setup will likely have even slower results. Lua is fantastic at describing data, even large amounts. The data capabilities, coupled with the scripting language itself, opens a wide world of format description, particularly for intermediate file formats that are translated into optimized game formats.

Is Lua appropriate everywhere? Certainly not. A game should read memory overlays from the disk whenever possible. Some data is best loaded directly into video memory and copying it from system memory would be a waste of time. When there is a special case to be handled, Lua should be bypassed. When there isn't, why shouldn't it be used? What would you suggest I use?

It seems to me the argument is that .lua files should only be distributed as text; the binary reader is not useful because the text parser is so fast. I've shown a very common use case where the standard Lua binary reader is much faster than the text reader. Based on this benchmark and many others I've run for smaller code and data sets, I am certain the binary reader will always be faster than the text reader.

Josh