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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user