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

Strip debugging symbols from Linux binaries #493

Merged
merged 2 commits into from Dec 17, 2021

Conversation

bwoodsend
Copy link
Collaborator

Fixes nothing.

Changes proposed in this pull request:

Apply strip to remove all debugging only symbols from binaries. Doing so reduces the size of the package (around 250KB reduces to 50KB on Linux) at the expense of being less friendly to debug using gdb (GNU's debugger) (ever use C debuggers when using ujson?).

@bwoodsend
Copy link
Collaborator Author

Ahh, I see that this doesn't work on macOS after all...

Doing so reduces the size of the package at the expense of being less friendly
to debug using gdb (GNU's debugger).
@bwoodsend bwoodsend changed the title Strip debugging symbols from Unix binaries. Strip debugging symbols from Linux binaries. Dec 16, 2021
@bwoodsend bwoodsend marked this pull request as ready for review December 16, 2021 23:01
@bwoodsend
Copy link
Collaborator Author

In hindsight, I really should have suggested this before the major version bump in case this knocks out some quirky Linux distribution that normally has to install ujson from source.

@hugovk
Copy link
Member

hugovk commented Dec 17, 2021

Thanks! I guess we could always put this out right away as 6.0.0, but maybe a quick 5.1.0 with just this will be fine and we can revert and/or major bump if needed.

@hugovk hugovk added the changelog: Changed For changes in existing functionality label Dec 17, 2021
@hugovk hugovk changed the title Strip debugging symbols from Linux binaries. Strip debugging symbols from Linux binaries Dec 17, 2021
@hugovk hugovk merged commit 682c660 into ultrajson:main Dec 17, 2021
@hugovk
Copy link
Member

hugovk commented Dec 17, 2021

Quick comparison of Linux wheel sizes, https://test.pypi.org/project/ujson/4.3.1.dev8/#files vs. https://test.pypi.org/project/ujson/5.0.1.dev3/#files:

218.5 kB	53.1 kB		cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
213.0 kB	43.5 kB		cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
215.8 kB	44.0 kB		cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
758.2 kB	576.7 kB		cp37-cp37m-musllinux_1_1_aarch64.whl
816.2 kB	646.6 kB		cp37-cp37m-musllinux_1_1_i686.whl
774.1 kB	588.9 kB		cp37-cp37m-musllinux_1_1_x86_64.whl
220.5 kB	53.3 kB		cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
215.2 kB	43.5 kB		cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
218.4 kB	44.2 kB		cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
759.4 kB	576.7 kB		cp38-cp38-musllinux_1_1_aarch64.whl
817.1 kB	646.7 kB		cp38-cp38-musllinux_1_1_i686.whl
775.2 kB	589.0 kB		cp38-cp38-musllinux_1_1_x86_64.whl
220.5 kB	53.3 kB		cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
215.0 kB	43.5 kB		cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
218.5 kB	44.2 kB		cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
760.4 kB	576.7 kB		cp39-cp39-musllinux_1_1_aarch64.whl
818.2 kB	646.7 kB		cp39-cp39-musllinux_1_1_i686.whl
776.1 kB	589.1 kB		cp39-cp39-musllinux_1_1_x86_64.whl
220.7 kB	53.1 kB		cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
215.4 kB	43.5 kB		cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
219.0 kB	44.1 kB		cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
761.4 kB	576.7 kB		cp310-cp310-musllinux_1_1_aarch64.whl
819.0 kB	646.7 kB		cp310-cp310-musllinux_1_1_i686.whl
777.1 kB	589.0 kB		cp310-cp310-musllinux_1_1_x86_64.whl
265.8 kB	95.3 kB		pp37-pypy37_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
45.3 kB	40.4 kB		pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
257.2 kB	80.7 kB		pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
267.8 kB	95.4 kB		pp38-pypy38_pp73-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
45.3 kB	40.5 kB		pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
259.7 kB	80.8 kB		pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

13164.0 kB	8245.9 kB

That's 37% smaller on average: smallest saving 11%, largest 80%.

@bwoodsend bwoodsend deleted the strip-binaries branch December 17, 2021 18:51
@bwoodsend
Copy link
Collaborator Author

@hugovk Can you ping me an email (address is on my profile)? Someone is trying to ask about a security issue in ultrajson but I don't have any contact info for you so I can't copy you in.

@hugovk
Copy link
Member

hugovk commented Jan 24, 2022

Yep, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Changed For changes in existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants