Skip to content

Commit 2ae9407

Browse files
committed
perf(cont): continue refining performance concerns
1 parent 48e32cd commit 2ae9407

33 files changed

Lines changed: 282 additions & 339 deletions

lua/fuzzy/init.lua

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,14 @@ function M.setup(opts)
1717
},
1818
scheduler = {
1919
async_budget = 1 * 1e6,
20-
trace = nil,
2120
},
2221
pool = {
23-
max_idle = 5 * 60 * 1000,
24-
prune_interval = 30 * 1000,
25-
max_tables = nil,
2622
prime_min = 16384,
2723
prime_max = 524288,
28-
prime_chunk = 8192,
2924
},
3025
registry = {
3126
max_idle = 5 * 60 * 1000,
3227
prune_interval = 30 * 1000,
33-
trace = nil,
3428
},
3529
})
3630

@@ -69,7 +63,6 @@ function M.setup(opts)
6963

7064
vim.api.nvim_set_hl(0, "SelectLineHighlight", { link = "Normal", default = false })
7165
vim.api.nvim_set_hl(0, "SelectDecoratorDefault", { link = "Normal", default = false })
72-
7366
end
7467

7568
return M

lua/fuzzy/match.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ function Match.new(opts)
453453
})
454454
opts = vim.tbl_deep_extend("force", {
455455
ephemeral = true,
456-
step = 50000,
456+
step = 65536,
457457
limit = 4096,
458458
timer = 100,
459459
}, opts)

lua/fuzzy/picker.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,7 @@ function Picker:_flush_direct()
659659
-- arrives from the stream we have to re-roder them all and re-match them in accordance to the query
660660
local query = self.select:query()
661661

662-
-- If the query did not change between stream chunk deliveries there is no need to re-match or re-display. However if the query
663-
-- changed we have to do a match on all accumulated stream entries thus far, to reflect the matching state of these entries
662+
-- If the query changed we have to do a match on all stream entries thus far, to reflect the matching state of these entries
664663
-- while the stream is still emitting
665664
if #all > 0 and type(query) == "string" and #query > 0 then
666665
self.match:match(all, query, function(matching)
@@ -674,7 +673,6 @@ function Picker:_flush_direct()
674673
end
675674
self.select:list(nil, nil)
676675
else
677-
-- Merge new matches into the accumulator and render.
678676
self.select:list(matching[1], matching[2])
679677
self.select:status(string.format(
680678
"%d/%d", #matching[1], #all
@@ -917,8 +915,8 @@ function Picker.new(opts)
917915
highlighters = {},
918916
match_limit = nil,
919917
match_timer = 30,
920-
match_step = 75000,
921-
stream_step = 150000,
918+
match_step = 65536,
919+
stream_step = 131072,
922920
stream_type = "lines",
923921
stream_debounce = 0,
924922
window_size = 0.20,

lua/fuzzy/pickers/blines.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ function M.open_blines_picker(opts)
7171
end,
7272
}, opts, {
7373
match_timer = 10,
74-
match_step = 10000,
75-
stream_step = 20000,
74+
match_step = 8192,
75+
stream_step = 16384,
7676
stream_debounce = 0,
7777
prompt_debounce = 30,
7878
}))

lua/fuzzy/pickers/btags.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ function M.open_btags_picker(opts)
6060
end,
6161
}, opts, {
6262
match_timer = 5,
63-
match_step = 2000,
64-
stream_step = 4000,
63+
match_step = 2048,
64+
stream_step = 4096,
6565
stream_debounce = 0,
6666
prompt_debounce = 25,
6767
}))

lua/fuzzy/pickers/buffers.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ function M.open_buffers_picker(opts)
256256
end,
257257
}, opts, {
258258
match_timer = 10,
259-
match_step = 5000,
260-
stream_step = 10000,
259+
match_step = 4096,
260+
stream_step = 8192,
261261
stream_debounce = 0,
262262
prompt_debounce = 30,
263263
}))

lua/fuzzy/pickers/changes.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ function M.open_changes_picker(opts)
8383
end,
8484
}, opts, {
8585
match_timer = 5,
86-
match_step = 2000,
87-
stream_step = 4000,
86+
match_step = 2048,
87+
stream_step = 4096,
8888
stream_debounce = 0,
8989
prompt_debounce = 25,
9090
}))

lua/fuzzy/pickers/colorscheme.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ function M.open_colorscheme_picker(opts)
8181
},
8282
}, opts, {
8383
match_timer = 5,
84-
match_step = 1000,
85-
stream_step = 2000,
84+
match_step = 1024,
85+
stream_step = 2048,
8686
stream_debounce = 0,
8787
prompt_debounce = 20,
8888
}))

lua/fuzzy/pickers/command_history.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ function M.open_command_history(opts)
4444
},
4545
}, opts, {
4646
match_timer = 5,
47-
match_step = 1000,
48-
stream_step = 2000,
47+
match_step = 1024,
48+
stream_step = 2048,
4949
stream_debounce = 0,
5050
prompt_debounce = 20,
5151
}))

lua/fuzzy/pickers/commands.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ function M.open_commands_picker(opts)
7979
},
8080
}, opts, {
8181
match_timer = 5,
82-
match_step = 2000,
83-
stream_step = 4000,
82+
match_step = 2048,
83+
stream_step = 4096,
8484
stream_debounce = 0,
8585
prompt_debounce = 25,
8686
}))

0 commit comments

Comments
 (0)