snacks.nvim/lua
Joshua Li b91f417670
perf(dashboard): speed up filtering for recent_files (#1250)
## Description

I have 5000 oldfiles, every time i go to a new directory and open nvim,
the dashboard recent_files (with `cwd=true`) computation takes 4-5
seconds to go through all oldfiles before deciding nothing should show
up

```lua
sections = {
  { icon = " ", title = "Recent files (current directory)", section = "recent_files", cwd = true },
}
```

It appears to be the `vim.v.oldfiles[i]` indexing. I didn't look much
into it but it opens much faster looping with ipairs.

Repro:
1. add the above section config in dashboard
2. increase oldfiles limit and populate up to the limit
3. `mkdir brand-new-directory; cd brand-new-directory; nvim`
4. the section is empty as expected, but it takes a few seconds before
dashboard shows up

## Related Issue(s)

<!--
  If this PR fixes any issues, please link to the issue here.
  - Fixes #<issue_number>
-->

## Screenshots

<!-- Add screenshots of the changes if applicable. -->
2025-02-18 23:05:55 +01:00
..
snacks perf(dashboard): speed up filtering for recent_files (#1250) 2025-02-18 23:05:55 +01:00
trouble/sources Revert "feat: test" 2025-02-14 22:13:38 +01:00