-
Notifications
You must be signed in to change notification settings - Fork 4
Description
It should be possible to opportunistically enable full link-time optimization in a cross-language way that would allow the compiled lightning library to be optimized directly with the lightning-sys wrappers. This would probably only work when clang was used for the entire compilation, and would probably not work in general with #21, but the build could fall back to its current behavior under those circumstances.
Without this LTO, lightning-sys is at a bit of a performance disadvantage when building a JITted function, because there is always at least one extra function call involved compared with the native C version. With LTO, this disadvantage would be entirely removed, and in fact the Rust version has a chance of being even faster than the native C version.
I would like to work on this issue myself eventually; creating an issue seemed like a good way to track it and collect information.