Skip to content

perf: improve startup time by deferring config defaults #2119

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025

Conversation

EdenEast
Copy link
Contributor

This change wraps the function _man_cmd_fn which checks the system to find which man previewer is installed. This system check is expensive and does not need to be called until it is actually required. This reduces the startup time of fzf-lua. An example of the difference via vim-startuptime:

Before:

event                  time percent
fzf-lua               41.34   42.38
fzf-lua.config        37.96   38.91
fzf-lua.defaults      37.57   38.51

After:

event                  time percent
fzf-lua                3.29    5.66
fzf-lua.config         0.98    1.69
fzf-lua.path           0.67    1.15
fzf-lua.defaults       0.53    0.91

Relates: #970

This change wraps the function `_man_cmd_fn` which checks the system to
find which man previewer is installed. This system check is expensive
and does not need to be called until it is actually required. This
reduces the startup time of fzf-lua. An example of the difference:

Before:
event                  time percent
fzf-lua               41.34   42.38
fzf-lua.config        37.96   38.91
fzf-lua.defaults      37.57   38.51

After:
event                  time percent
fzf-lua                3.29    5.66
fzf-lua.config         0.98    1.69
fzf-lua.path           0.67    1.15
fzf-lua.defaults       0.53    0.91
@ibhagwan
Copy link
Owner

Ty @EdenEast!

@ibhagwan ibhagwan merged commit 05eaee3 into ibhagwan:main Jun 20, 2025
@EdenEast EdenEast deleted the 970-perf-man-pager branch June 20, 2025 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants