Skip to content
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

perf(mappings): avoid computing error string on hot path #429

Merged
merged 1 commit into from Apr 16, 2023

Conversation

alaviss
Copy link
Contributor

@alaviss alaviss commented Apr 7, 2023

Profiling with perfanno.nvim shows that a large portion of startup time was spent on this line due to the computation of the error string.

This commit avoids computing the problematic error string unless it is going to be raised.

Startup time as recorded by lazy.nvim shows a reduction of 28% with this change: 13.43ms -> 10.49ms.

Profiling with perfanno.nvim shows that a large portion of startup time
was spent on this line due to the computation of the error string.

This commit avoids computing the problematic error string unless it is
going to be raised.

Startup time as recorded by lazy.nvim shows a reduction of 28% with this
change: 13.43ms -> 10.49ms.
@folke folke merged commit 6892f16 into folke:main Apr 16, 2023
@folke
Copy link
Owner

folke commented Apr 16, 2023

good catch. Thanks!!

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.

None yet

2 participants