zamazan4ik opened a new issue, #154:
URL: https://github.com/apache/sedona-db/issues/154

   Hi!
   
   I noticed that in the `Cargo.toml` file Link-Time Optimization (LTO) for the 
project is not enabled. I suggest switching it on since it will reduce the 
binary size (always a good thing to have) and will likely improve the 
application's performance. If you want to read more about LTO and its possible 
modes, I recommend starting from 
[this](https://doc.rust-lang.org/rustc/codegen-options/index.html#lto) Rustc 
documentation.
   
   I recommend enabling LTO only for Release builds so developers experience 
won't be affected by the increased build time. Actually, I can propose to use 
flags directly from the `ripgrep` 
[profile](https://github.com/BurntSushi/ripgrep/blob/cbc598f245f3c157a872b69102653e2e349b6d92/Cargo.toml#L76).
 
   
   Basically, it can be enabled with the following lines to the root Cargo.toml 
file:
   
   ```
   [profile.release]
   codegen-units = 1
   lto = true # FullLTO - the most aggressive LTO version
   ```
   
   I have made quick tests (AMD Ryzen 9 5900x, Fedora 42, Rust 1.89, the latest 
version of the project at the moment, `cargo build -r --workspace` command, 
without stripping) - here are the results:
   
   | Profile \ Binary name | `sedona-cli` | `lib_lib.so` |
   | --- | --- | --- |
   | Release (current) | 151 Mib | 160 Mib |
   | Release + ThinLTO + CU1 | 110 Mib | 115 Mib |
   | Release + FatLTO + CU1 | 97 Mib | 100 Mib |
   
   Clean build times:
   
   * Release (current): 3m 12s
   * Release + ThinLTO + CU1: 4m 28s
   * Release + FatLTO + CU1: 9m 38s
   
   I haven't done performance benchmark but expect that FatLTO version will be 
the most performant too.
   
   Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to