[Google Pixel 3a XL ROMs, Kernels, Recoveries, & Ot] gee one:
I'll have to pay around with this. Maybe the magisk module doesn't use/support compression?

I peeked inside the twrp image file and the ramdisk is something like 15mb and the kernel is 10mb. I repacked it by hand and it was 34mb total.

The magisk binary is executable on your phone and should take a --help flag that explains the commands. I've looked at it before, but didn't spend too much time since I usually assemble my own boot/recovery at build time.

---------- Post added at 12:32 PM ---------- Previous post was at 12:22 PM ----------

It looks like the magiskboot module supports compression.

I suppose that we could test to see if repacking by hand with compression makes a difference. If it does, then maybe wehave to dig around in the twrp/android_bootable_recovery to see if this is getting set. If not, then the issue is elsewhere?

root@sargo:/tmp # ./magiskboot --help
MagiskBoot v19.0(19000) (by topjohnwu) - Boot Image Modification Tool
Usage: ./magiskboot <action> [args...]

Supported actions:
unpack [-h] <bootimg>
Unpack <bootimg> to, if available, kernel, kernel_dtb, ramdisk.cpio,
second, dtb, extra, and recovery_dtbo into current directory.
If '-h' is provided, it will dump header info to 'header',
which will be parsed when repacking.
Return values:
0:valid 1:error 2:chromeos

repack <origbootimg> [outbootimg]
Repack boot image components from current directory
to [outbootimg], or new-boot.img if not specified.
It will compress ramdisk.cpio and kernel with the same method in
<origbootimg> if the file provided is not already compressed.

hexpatch <file> <hexpattern1> <hexpattern2>
Search <hexpattern1> in <file>, and replace with <hexpattern2>

cpio <incpio> [commands...]
Do cpio commands to <incpio> (modifications are done directly)
Each command is a single argument, use quotes if necessary
Supported commands:
exists ENTRY
Return 0 if ENTRY exists, else return 1
rm [-r] ENTRY
Remove ENTRY, specify [-r] to remove recursively
mkdir MODE ENTRY
Create directory ENTRY in permissions MODE
ln TARGET ENTRY
Create a symlink to TARGET with the name ENTRY
mv SOURCE DEST
Move SOURCE to DEST
add MODE ENTRY INFILE
Add INFILE as ENTRY in permissions MODE; replaces ENTRY if exists
extract [ENTRY OUT]
Extract ENTRY to OUT, or extract all entries to current directory
test
Test the current cpio's patch status
Return values:
0:stock 1:Magisk 2:unsupported (phh, SuperSU, Xposed)
patch KEEPVERITY KEEPFORCEENCRYPT
Ramdisk patches. KEEP**** are boolean values
backup ORIG
Create ramdisk backups from ORIG
restore
Restore ramdisk from ramdisk backup stored within incpio
sha1
Print stock boot SHA1 if previously backed up in ramdisk

dtb-<cmd> <dtb>
Do dtb related cmds to <dtb> (modifications are done directly)
Supported commands:
dump
Dump all contents from dtb for debugging
test
Check if fstab has verity/avb flags
Return values:
0:no flags 1:flag exists
patch
Search for fstab and remove verity/avb

compress[=method] <infile> [outfile]
Compress <infile> with [method] (default: gzip), optionally to [outfile]
<infile>/[outfile] can be '-' to be STDIN/STDOUT
Supported methods: bzip2 gzip lz4 lz4_legacy lzma xz

decompress <infile> [outfile]
Detect method and decompress <infile>, optionally to [outfile]
<infile>/[outfile] can be '-' to be STDIN/STDOUT
Supported methods: bzip2 gzip lz4 lz4_legacy lzma xz

sha1 <file>
Print the SHA1 checksum for <file>

cleanup
Cleanup the current working directory

---------- Post added at 12:41 PM ---------- Previous post was at 12:32 PM ----------

Hold the phone...

The source.boot.img was dd'd from my phone, so it is the full partition. I unpacked it with the magiskboot module. The kernel is build from the LOS repo- it's 53MB. The ramdisk is 15MB. After repacking, the new-boot-img is 30M.

I guess the next step is to check the bootable recovery repo so see how this is getting re-packed in twrp... maybe? It seems as if the magisk module is capable of compressing the boot.img.

root@sargo:/tmp/unpack # ls -lh
total 81M
-rw-rw-rw- 1 root root 326 1970-01-15 13:11 header
-rw-r--r-- 1 root root 53M 1970-01-15 13:11 kernel
-rw-r--r-- 1 root root 368K 1970-01-15 13:11 kernel_dtb
-rw-r--r-- 1 root root 30M 1970-01-15 13:12 new-boot.img
-rw-r--r-- 1 root root 15M 1970-01-15 13:11 ramdisk.cpio
-rw-rw-rw- 1 root root 64M 1970-01-15 13:10 source.boot.img

dd if=/dev/block/bootdevice/by-name/boot_b of=source.boot.img
./magiskboot --help
./magiskboot unpack -h source.boot.img
//magiskboot repack source.boot.img