feat(performance): Major performance improvements using async v2 from @oberblastmeister (#987)

* start: Working w/ async jobs

* short circuit to using bad finder if you pass writer.
This commit is contained in:
TJ DeVries
2021-08-20 11:11:24 -04:00
committed by GitHub
parent d6d28dbe32
commit a97af306c4
56 changed files with 626 additions and 2493 deletions

View File

@@ -155,7 +155,10 @@ function EntryManager:add_entry(picker, score, entry)
info.looped = info.looped + 1
if container[2] > score then
-- print("Inserting: ", picker, index, node, new_container)
return self:_insert_container_before(picker, index, node, new_container)
end
if score < 1 and container[2] == score and #entry.ordinal < #container[1].ordinal then
return self:_insert_container_before(picker, index, node, new_container)
end
@@ -174,11 +177,13 @@ function EntryManager:add_entry(picker, score, entry)
end
function EntryManager:iter()
return coroutine.wrap(function()
for val in self.linked_states:iter() do
coroutine.yield(val[1])
local iterator = self.linked_states:iter()
return function()
local val = iterator()
if val then
return val[1]
end
end)
end
end
return EntryManager