-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[core] Reduce size of libCling #20019
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
Conversation
After inlining and hiding symbols, some of them are not referenced anymore and can be collected by the linker, reducing the library size from 120 MB to 105 MB in a Release configuration with GCC.
This is optional during installation, but we always want it because of the large gains, reducing the size of the library further from 105 MB to 88 MB.
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!
We might be able to do better because even if libCling is a shared library it is self contained. That is we don’t expose any of these llvm interfaces outside. I am not sure if we can express that to the linker but practically we can strip a lot of symbols as if we were building a binary.
Hiding symbols, garbage collecting unused stuff and |
I believe if I build some binary on top of llvm built with hidden visibility I will get the overall size to be smaller. In addition, it seems some of the linked in JIT components might not be needed. Forgot what those were but I am surprised that if the linker does not find them. |
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.
Nice ideas, thanks!
Test Results 21 files 21 suites 3d 16h 34m 39s ⏱️ Results for commit 99ee373. |
Garbage collect unused sections and strip the library after build, reducing its size from 120 MB to 88 MB in a
Releaseconfiguration with GCC. See the individual commit messages for more details.FYI @vepadulano maybe interesting for the Python wheels, though we will grow in size again with each LLVM upgrade...