Statically linked with libsqlite3.a with LTO enabled#16
Statically linked with libsqlite3.a with LTO enabled#16NobodyXu wants to merge 28 commits intoavinassh:masterfrom
Conversation
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
in `cargo build` Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
that automatically compile sqlite3 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Since sqlx adds feature `bundled` to `libsqlite3-sys` which is used by `rusqlite`, preventing from using my LTO compiled libsqlite3.a, I added a feature to disable it. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
SQLITE3_INCLUDE_DIR is necessary since libsqlite3-sys does not use sqlite3.pc found using `SQLITE3_LIB_DIR` for locating the header. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
This benchmark result is outdated It seems that linking with sqlite3 with LTO does provides some minor benefit. |
|
I looked at the assembly and found that not all I think this might have something to do with the default Since And, |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
The latest commit enables However, I currently don't have any time to benchmark this new commit. |
|
Here's the up-to-date benchmark: However, after investigation, I still found many |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
I think I have been mistaken, as the |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
By doing the Here's the benchmark: There isn't much improvments, so I will use |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
|
Here are the flamegraphs for the rust binaries. |
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This PR enables binaries who uses
rusqliteto statically linked withlibsqlite3.acompiled with LTO using linker-plugin-lto.To compile these binaries (excluding
basic_async.rs), just runmake -j $(nproc).It will compile
sqlite3.cusingCFLAGS='-O2 -flto'.The generated binaries will be smaller,
though I haven't tested the performance yet, I will add the benchmark below as a commentbut only provides minor performance improvements (see comments below)It seems that I didn't enable LTO in rust (see comments below).To compile
basic_async.rs, runcargo build --release --bin basic_async --features async-sql.This PR might be related to #14
Signed-off-by: Jiahao XU Jiahao_XU@outlook.com