mirror of
https://github.com/BlackMATov/evolved.lua.git
synced 2025-12-15 12:19:47 +07:00
bytecode table from cache
This commit is contained in:
@@ -8,5 +8,5 @@
|
|||||||
- optimize batch operations for cases with moving entities to empty chunks
|
- optimize batch operations for cases with moving entities to empty chunks
|
||||||
- should we clear chunk's components by on_insert tag callback?
|
- should we clear chunk's components by on_insert tag callback?
|
||||||
- use table.new/clear for cached tables
|
- use table.new/clear for cached tables
|
||||||
- replace chunk_list/fragment_list pools to one generic table pool
|
|
||||||
- replace id type aliases with separated types to hide implementation details
|
- replace id type aliases with separated types to hide implementation details
|
||||||
|
- clear chunk's tables instead reallocating them
|
||||||
|
|||||||
@@ -1231,7 +1231,7 @@ local function __defer_commit()
|
|||||||
local bytecode = __defer_bytecode
|
local bytecode = __defer_bytecode
|
||||||
|
|
||||||
__defer_length = 0
|
__defer_length = 0
|
||||||
__defer_bytecode = {}
|
__defer_bytecode = __acquire_table()
|
||||||
|
|
||||||
local bytecode_index = 1
|
local bytecode_index = 1
|
||||||
while bytecode_index <= length do
|
while bytecode_index <= length do
|
||||||
@@ -1239,6 +1239,7 @@ local function __defer_commit()
|
|||||||
bytecode_index = bytecode_index + op(bytecode, bytecode_index + 1) + 1
|
bytecode_index = bytecode_index + op(bytecode, bytecode_index + 1) + 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
__release_table(bytecode)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1984,6 +1985,7 @@ function evolved.batch_set(query, fragment, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return set_count, false
|
return set_count, false
|
||||||
end
|
end
|
||||||
@@ -2015,6 +2017,7 @@ function evolved.batch_assign(query, fragment, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return assigned_count, false
|
return assigned_count, false
|
||||||
end
|
end
|
||||||
@@ -2046,6 +2049,7 @@ function evolved.batch_insert(query, fragment, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return inserted_count, false
|
return inserted_count, false
|
||||||
end
|
end
|
||||||
@@ -2076,6 +2080,7 @@ function evolved.batch_remove(query, ...)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return removed_count, false
|
return removed_count, false
|
||||||
end
|
end
|
||||||
@@ -2105,6 +2110,7 @@ function evolved.batch_clear(query)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return cleared_count, false
|
return cleared_count, false
|
||||||
end
|
end
|
||||||
@@ -2134,6 +2140,7 @@ function evolved.batch_destroy(query)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
__defer_commit()
|
__defer_commit()
|
||||||
|
|
||||||
__release_table(chunk_list)
|
__release_table(chunk_list)
|
||||||
return destroyed_count, false
|
return destroyed_count, false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user