perf: reduce time-to-interactive for large git repos #109
No reviewers
Labels
No labels
autorelease: pending
autorelease: tagged
bug
ci/cd
documentation
duplicate
enhancement
good first issue
help wanted
improvement
invalid
priority
high
priority
low
question
refactor
size
L
size
M
size
S
size
XS
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
noe.trevino/haunt.nvim!109
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "perf/improve-time-to-interactive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Checklist
CONTRIBUTING.md./scripts/test) locallyREADME.mdif applicableSummary
time-to-interactive: The time it takes from launching neovim until the user can perform inputs.
This PR improves the time-to-interactive when haunt.nvim is in the runtime path and particularly if the git repository in which neovim is launched is quite large.
This is achieved by replacing the command
git rev-list --max-parents=0 HEADwithgit rev-list -n 1 --max-parents=0 HEADinside of theproject_id_with_root()function, as only the very first result is needed.In my checkout of the quite sizable
NixOS/nixpkgsrepo this improves the time-to-interactive by over 4 seconds.Ideally haunt.nvim never increases the time-to-interactive, no matter how long specific
gitcommands take. Maybe that will be possible with the upcomingvim.asyncapi.I am looking forward to
vim.async! Thank you for the contribution. I will be moving this into nightly for testing and then merge into main probably this weekendchanges base again so PR would recalculate diff (thanks github)