summaryrefslogtreecommitdiff
path: root/lua/tests/manual/profile_for_sorters.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2021-08-20 11:11:24 -0400
committerGitHub <noreply@github.com>2021-08-20 11:11:24 -0400
commita97af306c4e9c9a6fa7c886c0ffe3079822c5203 (patch)
treef5e2b50a767e93618d0d8fdddb8a964c90633c8a /lua/tests/manual/profile_for_sorters.lua
parentd6d28dbe324de9826a579155076873888169ba0f (diff)
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.
Diffstat (limited to 'lua/tests/manual/profile_for_sorters.lua')
-rw-r--r--lua/tests/manual/profile_for_sorters.lua70
1 files changed, 0 insertions, 70 deletions
diff --git a/lua/tests/manual/profile_for_sorters.lua b/lua/tests/manual/profile_for_sorters.lua
deleted file mode 100644
index 05a657a..0000000
--- a/lua/tests/manual/profile_for_sorters.lua
+++ /dev/null
@@ -1,70 +0,0 @@
--- TODO: Add a ladder test.
--- 1, 2, 4, 8, 16, 32 attempts
-
-RELOAD "plenary"
--- RELOAD('telescope')
-
-local profiler = require "plenary.profile.lua_profiler"
-local Job = require "plenary.job"
-
-BIG_LIST = nil
-BIG_LIST = BIG_LIST or Job:new({ command = "fdfind", cwd = "~/build/" }):sync()
-print(#BIG_LIST)
-
-local do_profile = true
-local sorter_to_test = require("telescope.sorters").get_fuzzy_file()
-
-local strings_to_test = { "", "ev", "eval.c", "neovim/eval.c" }
-
-if do_profile then
- profiler.start()
-end
-
-local first_results = setmetatable({}, {
- __index = function(t, k)
- local obj = {}
- rawset(t, k, obj)
- return obj
- end,
-})
-
-local second_results = {}
-
-local do_iterations = function(num)
- local start
- for _, prompt in ipairs(strings_to_test) do
- start = vim.fn.reltime()
-
- for _ = 1, num do
- for _, v in ipairs(BIG_LIST) do
- sorter_to_test:score(prompt, v)
- end
- end
- -- print("First Time: ", vim.fn.reltimestr(vim.fn.reltime(start)), num, prompt)
- table.insert(first_results[prompt], vim.fn.reltimestr(vim.fn.reltime(start)))
-
- start = vim.fn.reltime()
- for _ = 1, num do
- for _, v in ipairs(BIG_LIST) do
- sorter_to_test:score(prompt, v)
- end
- end
-
- -- print("Second Time: ", vim.fn.reltimestr(vim.fn.reltime(start)), num, prompt)
- table.insert(second_results, vim.fn.reltimestr(vim.fn.reltime(start)))
- end
-end
-
-do_iterations(1)
--- do_iterations(2)
--- do_iterations(4)
--- do_iterations(8)
--- do_iterations(16)
--- do_iterations(32)
-
-print(vim.inspect(first_results))
-
-if do_profile then
- profiler.stop()
- profiler.report "/home/tj/tmp/profiler_score.txt"
-end