在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):lujian101/LuaTableOptimizer开源软件地址(OpenSource Url):https://github.com/lujian101/LuaTableOptimizer开源编程语言(OpenSource Language):Lua 100.0%开源软件介绍(OpenSource Introduction):LuaTableOptimizerSimple readonly lua table optimizerLua Table 通常被用来存储游戏的配置数据,如果配置中有很多冗余重复的数据那么将占用较多的内存,严重影响加载速度 Lua table commonly use to store configuration data for games. it takes a lot of memory if it contains many fields with same value. this optimization could improve memory usage and loading speed. 功能
Features
Require
Before{
{
1,
2,
3,
a = "123",
b = "123"
},
{
1,
2,
3,
a = "123",
b = "123"
},
{
1,
2,
5,
a = "123",
b = "123"
},
[9] = {
1,
2,
5,
a = "123",
b = "123"
},
[11] = {
1,
2,
3,
a = "123",
b = "123",
c = {
{
1
},
{
1
},
{
2
},
{
2
}
},
d = {
{
1,
a = 1
},
{
2,
a = 2
}
},
e = {
{
1,
a = 1
},
{
2,
a = 2
}
}
},
[100] = {
1,
2,
3,
a = "tttt",
b = "123"
}
} Optimizedlocal __rt_1 = {
}
local __rt_2 = {
1,
2,
3
}
local __rt_3 = {
1,
2,
5
}
local __rt_4 = {
{
1,
a = 1
},
{
2,
a = 2
}
}
local __rt_5 = {
1
}
local __rt_6 = {
2
}
local test =
{
__rt_2,
__rt_2,
__rt_3,
[9] = __rt_3,
[11] = {
1,
2,
3,
c = {
__rt_5,
__rt_5,
__rt_6,
__rt_6
},
d = __rt_4,
e = __rt_4
},
[100] = {
1,
2,
3,
a = "tttt"
}
}
local __default_values = {
a = "123",
b = "123",
c = __rt_1,
d = __rt_1,
e = __rt_1
}
do
local base = { __index = __default_values, __newindex = function() error( "Attempt to modify read-only table" ) end }
for k, v in pairs( test ) do
setmetatable( v, base )
end
base.__metatable = false
end
return test |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论