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

Enable link-time optimization for Vim in MacVim CI builds #1314

Closed

Conversation

ychin
Copy link
Member

@ychin ychin commented Oct 15, 2022

From local profiling, enabling LTO for Vim gives a small but measurable improvement to performance. One test that I did was to open a really large Markdown file with vim-markdown (which usually chokes at large files) installed, and measure how long that takes. With LTO turned on, usually it gives at least 4-9% performance boost, which seems significant enough to justify turning it on as we essentially get the improvement for free (I didn't see similar boosts in other benhcmarking I did though, so it depends). Slight caveat is that the binary size sees a small increase (presumably due to inlining) but it's not too much. It takes more time to build with this turned on though, so only do this in CI, for the publish builds (we don't do this for the other runs in the matrix so those runs can finish faster to provide timely feedbacks).

This doesn't change the compilation/linking options for MacVim binary itself as that doesn't seem to be where performance caps are.

@ychin ychin force-pushed the enable-ci-link-time-optimization branch from 2d39f5b to 90e91d4 Compare October 15, 2022 00:31
@ychin ychin changed the title Enable link-time optimization for MacVim CI builds Enable link-time optimization for Vim in MacVim CI builds Oct 15, 2022
@ychin ychin added this to the Release 175 milestone Oct 15, 2022
@ychin ychin force-pushed the enable-ci-link-time-optimization branch from 6dda3eb to 84d98cf Compare October 15, 2022 00:58
From local profiling, enabling LTO for Vim gives a small but measurable
improvement to performance. One test that I did was to open a really
large Markdown file with vim-markdown (which usually chokes at large
files) installed, and measure how long that takes. With LTO turned on,
usually it gives at least 6-10% performance boost, which seems
significant enough to justify turning it on as we essentially get the
improvement for free (I didn't see similar boosts in other benhcmarking
I did though, so it depends). Slight caveat is that the binary size sees
a small increase (presumably due to inlining) but it's not too much. It
takes more time to build with this turned on though, so only do this in
CI, for the publish builds (we don't do this for the other runs in the
matrix so those runs can finish faster to provide timely feedbacks).

This doesn't change the compilation/linking options for MacVim binary
itself as that doesn't seem to be where performance caps are.
@ychin ychin force-pushed the enable-ci-link-time-optimization branch 2 times, most recently from 88d7dd5 to bca7a90 Compare October 15, 2022 02:28
@ychin ychin force-pushed the enable-ci-link-time-optimization branch from bca7a90 to 491087b Compare October 15, 2022 07:38
They already depend on the relevant .o files, so no need to depend on
the whole folder. Depending on the objects folder make them stomp each
other all the time.
@ychin ychin force-pushed the enable-ci-link-time-optimization branch from 1efc562 to 26c39df Compare October 15, 2022 20:13
@ychin
Copy link
Member Author

ychin commented Oct 15, 2022

On further tests, I couldn't quite find a consistent improvement with LTO, and on the tests that show them, it's pretty slight (only a couple %). Since this change seems like it would bulk up the build time from 1-2m to 15 minutes on CI, and I would need to do further changes to the Makefile to make the dependencies happy, and also the fact that LTO binaries are larger, just closing this for now. No point in needless optimization.

@ychin ychin closed this Oct 15, 2022
@ychin ychin deleted the enable-ci-link-time-optimization branch October 15, 2022 23:43
@ychin ychin removed this from the Release 175 milestone Feb 4, 2023
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.

1 participant