Skip to content
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

Fix bloated liblimbo_sqlite3.a binary size #714

Open
penberg opened this issue Jan 16, 2025 · 1 comment
Open

Fix bloated liblimbo_sqlite3.a binary size #714

penberg opened this issue Jan 16, 2025 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@penberg
Copy link
Collaborator

penberg commented Jan 16, 2025

There's no reason for liblimbo_sqlite3.a to be this big:

limbo % ls -lh target/release/liblimbo_sqlite3.a
-rw-r--r--  1 penberg  staff    37M Jan 16 15:12 target/release/liblimbo_sqlite3.a

What's odd is that the shell image size makes much more sense and it packs the same functionality...

limbo % ls -lh target/release/limbo
-rwxr-xr-x  1 penberg  staff   3.8M Jan 16 15:13 target/release/limbo

Furthermore, the dynamic library is also fine:

sqlite3 % ls -lh ../target/release/liblimbo_sqlite3.dylib
-rwxr-xr-x  1 penberg  staff   3.1M Jan 16 15:16 ../target/release/liblimbo_sqlite3.dylib
@penberg penberg added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Jan 16, 2025
penberg added a commit that referenced this issue Jan 16, 2025
This reduces `liblimbo_sqlite3.a` size from 37M to 20M.

Refs #714
penberg added a commit that referenced this issue Jan 16, 2025
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out,
LLVM emits its bitcode into static libraries when LTO is enabled to be
"more aggressive" in optimizations

Refs #714
penberg added a commit that referenced this issue Jan 16, 2025
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out,
LLVM emits its bitcode into static libraries when LTO is enabled to be
"more aggressive" in optimizations

Refs #714
penberg added a commit that referenced this issue Jan 17, 2025
..to reduce `liblimbo_sqlite3.a` size from 37M to 20M. As it turns out,
LLVM emits its bitcode into static libraries when LTO is enabled to be
"more aggressive" in optimizations

Refs #714
penberg added a commit that referenced this issue Jan 17, 2025
This reduces `liblimbo_sqlite3.a` size from 37M to 15M.
Refs #714

Closes #715
@krishvishal
Copy link
Contributor

@penberg what linker are you using?

I'm using the default gcc linker and I'm getting larger sizes on the main

ls -lh target/release/liblimbo_sqlite3.a
-rw-r--r-- 2 kv kv 49M Jan 21 13:15 target/release/liblimbo_sqlite3.a

Previously I was using mold linker and it produced even larger (~65 MB) binary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants