* perf: avoid creating closure in cache.ensure and drop some cached getters
This mainly addresses the perf issue on large amount of calls to
`entry.new`. Previously every `cache.ensure` calls in the code path of
it creates an anonymous function, and it seems that luajit just could
not inline it. Function creation is not expensive in luajit, but that
overhead is noticeable if every `cache.ensure` call creates a function.
The first improvemnt is to solidate the cache callback and attach it to
the metatable of `entry`. This ensures that every created entry instance
share the same cache callback and no new functions will be frequently created,
reduces the ram usage and GC overhead.
To improve it further, some frequently accessed fields of entry like
`completion_item` and `offset` is refactored to use simple table access
instead of getter pattern. The current cached getter is implemented
using `cache.ensure`, which introduces two more levels of function calls
on each access: `cache.key` and `cache.get`. The overhead is okay if but
noticeable if entries amount is quite large: you need to call 4 functions on
a simple `completion_item` field access for each item.
All of the changes done in the commit is just constant time
optimization. But the different is huge if tested with LS providing
large amount of entries like tailwindcss.
* perf: delay fuzzy match on displayed vim item
`entry.get_vim_item` is a very heavy call, especially when user do
complex stuff on item formatting. Delay its call to window displaying to
let `performance.max_view_entries` applied to it.
* remove unneeded fill_defaults
* update gha
---------
Co-authored-by: hrsh7th <629908+hrsh7th@users.noreply.github.com>
* feat: sort source entries beforce slicing when using max_item_count
* feat: optimize filtering by max_item_count after sort
* fix: useless check if max_item_counts map is initialized
* fix: directly use entry source object when checking max_item_count
* Search mode horizontal view
Enabled by setting `experimental.horizontal_search = true`
* use stylua
* move to a floating window instead of abusing status line
* pass all tests
* rework
1. rename entries view file and memeber to wildmenu_entries_view
2. move config to config.view.entries
3. support both in insert mode and cmdline
4. make separator configurable by config.view.separator
* rearange wildmenu config
Changed config to:
```lua
view = {
entries = {name = 'wildmenu', separator = '|' }
},
```
* allow view.entries to be either a literal string or a table