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

@@ -1,7 +1,4 @@
local async_lib = require "plenary.async_lib"
local async = async_lib.async
local await = async_lib.await
local void = async_lib.void
local scheduler = require("plenary.async").util.scheduler
local make_entry = require "telescope.make_entry"
@@ -29,18 +26,18 @@ return function(opts)
results = results,
close = function() end,
}, {
__call = void(async(function(_, _, process_result, process_complete)
__call = function(_, _, process_result, process_complete)
for i, v in ipairs(results) do
if process_result(v) then
break
end
if i % 1000 == 0 then
await(async_lib.scheduler())
scheduler()
end
end
process_complete()
end)),
end,
})
end