[single-exe] Enable LTO when building corebundle #26697
Conversation
f28521c
to
8cb70b9
Compare
Curious to know where the ~20-35ms of startup time went when using LTO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
@@ -108,6 +108,8 @@ llvm_link="$(locate_llvm_exec link)" | |||
[[ $? -eq 0 ]] || { echo "Unable to locate llvm-link"; exit 1; } | |||
llvm_nm="$(locate_llvm_exec nm)" | |||
[[ $? -eq 0 ]] || { echo "Unable to locate llvm-nm"; exit 1; } | |||
llvm_ranlib="$(locate_llvm_exec ranlib)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why is adding the ranlib necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My surface understanding standing is that llvm-ranlib is intended to handle the clang output when when using the -flto
flag, whereas the standard ranlib does not. Really, I just hit errors with using the standard ranlib when trying to do this and looking around online indicated that llvm-ranlib should be used in order to use LTO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was removed in #1363 because openSUSE distro did not have ranlib. If openSUSE is not exercised in the CI, that might be broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@am11 thank you for the info. I had a feeling that it was removed intentionally in the past, but I haven't remembered the reason. We don't build anything on OpenSUSE in our CI.
I'm honestly not sure where exactly the startup time went (I wasn't really expecting it, but definitely not complaining). I think there were still issues getting dependable traces. |
Using the link-a-thon app, this drops about 25-30ms in total startup (startup + first request) and 0.35MB in the bundled app size.
Without LTO (28.91 MB app):
With LTO (28.56 MB app):