We have some of the smarted devs... pgloader is a great example
All, Just a good example of why SUSE/openSUSE is as good as it is. I built pgloader naively on Arch and the package was 23MiB. Then needed to install the same package on leap 15.4 and install was only 300KiB - WTF? Digging into the spec, the SUSE packager had noticed that the SBCL elf files contained gaps and no debug sections and so an objcopy of the executable would reduce the size by over 20M!!! Absolutely brilliant, and quite space efficient. I added the objcopy to the Arch build and presto, a 23M executable drops to just 400K. .spec explanation for the curious (like me) %install install -d %{buildroot}%{_bindir} # # SBCL produces ELF files that # (1.) have excessive gaps and which could be fixed by objcopy/strip/etc. # (2.) do not have any .debug_* sections, therefore rpm's debuginfo # mechanism (would do strip) does not trigger at all. # # Hence this copyin-copyout call with objcopy, which reduces filesize from 20MB # to 300KB. # objcopy bin/pgloader %{buildroot}%{_bindir}/pgloader Kudos to the packager! -- David C. Rankin, J.D.,P.E.
On 9/21/23 00:15, David C. Rankin wrote:
.spec explanation for the curious (like me)
%install install -d %{buildroot}%{_bindir} # # SBCL produces ELF files that # (1.) have excessive gaps and which could be fixed by objcopy/strip/etc. # (2.) do not have any .debug_* sections, therefore rpm's debuginfo # mechanism (would do strip) does not trigger at all. # # Hence this copyin-copyout call with objcopy, which reduces filesize from 20MB # to 300KB. # objcopy bin/pgloader %{buildroot}%{_bindir}/pgloader
Kudos to the packager!
Oh, and we were so damn close! But, alas, it appears the objcopy panacea wasn't all it was cracked up to be and that too much is trimmed from the original 20M binary, e.g. $ pgloader mysql://david:password@localhost/webauth postgresql:///webauth fatal error encountered in SBCL pid 19105 tid 19105: Can't find sbcl.core Uugh -- that was the problem I ran into when I updated the Arch package to build like SUSE did. Bummer, back to the bug report.... -- David C. Rankin, J.D.,P.E.
Thu, 21 Sep 2023 00:15:53 -0500 "David C. Rankin" <drankinatty@suddenlinkmail.com> :
All,
Just a good example of why SUSE/openSUSE is as good as it is. I built pgloader naively on Arch and the package was 23MiB. Then needed to install the same package on leap 15.4 and install was only 300KiB - WTF?
Digging into the spec, the SUSE packager had noticed that the SBCL elf files contained gaps and no debug sections and so an objcopy of the executable would reduce the size by over 20M!!!
Absolutely brilliant, and quite space efficient. I added the objcopy to the Arch build and presto, a 23M executable drops to just 400K.
.spec explanation for the curious (like me)
%install install -d %{buildroot}%{_bindir} # # SBCL produces ELF files that # (1.) have excessive gaps and which could be fixed by objcopy/strip/etc. # (2.) do not have any .debug_* sections, therefore rpm's debuginfo # mechanism (would do strip) does not trigger at all. # # Hence this copyin-copyout call with objcopy, which reduces filesize from 20MB # to 300KB. # objcopy bin/pgloader %{buildroot}%{_bindir}/pgloader
Kudos to the packager!
-- David C. Rankin, J.D.,P.E.
Excellent, if we could only force all the mozilla bloat-code to go through their cubicles too (not to mention nvidia and chrome)! -- Thursdays are Leap days: openSUSE Leap 15.5, Kernel=5.14.21-150500.55.19-default on x86_64, DM=sddm, DE=KDE, ST=x11,grub2, GPT, BIOS-boot https://imgur.com/ekrJUUt.png https://imgur.com/RsbswMP.png
On 9/21/23 05:59, bent fender wrote:
Excellent, if we could only force all the mozilla bloat-code to go through their cubicles too (not to mention nvidia and chrome)!
Amen, I don't know if you ever have a need to move your databases around, but moving to postgres from mysql could not be easier. I was floored. pgloader in one short command line can completely move a MySQL database to postgres at a rate of millions of records per-second. Preserving the complex tables relations, etc.. and even read the database to duplicated across encrypted network connections from a remote host. Every bit a slick as creating a .pdf on the fly with groff/troff! Between mozilla, nvidia and chrome we could probably save 600M in package sizes and never notice the loss. With pgloader, the savings of 22.5M on a 23M executable was pretty astonishing. I'm sure that worked fine in the past, but there was likely a change to the SBCL library that prevents the same objcopy trick from working with the current version. To pick up on the savings in the first place and apply it to the SUSE rpm was still a stoke of genius. -- David C. Rankin, J.D.,P.E.
Thu, 21 Sep 2023 20:22:12 -0500 "David C. Rankin" <drankinatty@suddenlinkmail.com> :
On 9/21/23 05:59, bent fender wrote:
Excellent, if we could only force all the mozilla bloat-code to go through their cubicles too (not to mention nvidia and chrome)!
Amen,
I don't know if you ever have a need to move your databases around, but moving to postgres from mysql could not be easier. I was floored. pgloader in one short command line can completely move a MySQL database to postgres at a rate of millions of records per-second. Preserving the complex tables relations, etc.. and even read the database to duplicated across encrypted network connections from a remote host. Every bit a slick as creating a .pdf on the fly with groff/troff!
Between mozilla, nvidia and chrome we could probably save 600M in package sizes and never notice the loss. With pgloader, the savings of 22.5M on a 23M executable was pretty astonishing. I'm sure that worked fine in the past, but there was likely a change to the SBCL library that prevents the same objcopy trick from working with the current version.
I vaguely remember a thing called *crunching* from my Amiga past in another life, maybe on another planet. There was also a companion of that philosophy which I think was called ivestigative-testing (my dad once told me about that what-if thingie). But I'm no guru, I was never a developer, so wtf do I know...
participants (2)
-
bent fender
-
David C. Rankin