Huge difference in factory and sysupgrade filesize

So I build openwrt snapshot and both devices have the same version.buildinfo
r16366-6a6b5a677e

r7800.diffconfig

CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_ipq806x_generic=y
CONFIG_TARGET_ipq806x_generic_DEVICE_netgear_r7800=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_DIFF=y
CONFIG_BUSYBOX_CONFIG_ED=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DIFF_DIR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=32
CONFIG_BUSYBOX_CONFIG_PATCH=y
CONFIG_BUSYBOX_CONFIG_PKILL=y
CONFIG_BUSYBOX_CONFIG_WHOAMI=y
CONFIG_PACKAGE_arp-scan=y
CONFIG_PACKAGE_arp-scan-database=y
# CONFIG_PACKAGE_ath10k-firmware-qca9984-ct is not set
CONFIG_PACKAGE_ath10k-firmware-qca9984-ct-full-htt=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_dawn=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_ddns-scripts-services=y
# CONFIG_PACKAGE_iw is not set
CONFIG_PACKAGE_iw-full=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libgcrypt=y
CONFIG_PACKAGE_libgpg-error=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuuid=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-dawn=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-diag-core=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-ntpc=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-ipkg=y
CONFIG_PACKAGE_luci-lib-json=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-proto-relay=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_luci-theme-material=y
CONFIG_PACKAGE_luci-theme-openwrt=y
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_ntpclient=y
CONFIG_PACKAGE_px5g-wolfssl=y
CONFIG_PACKAGE_relayd=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_umdns=y
CONFIG_PACKAGE_wireless-tools=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
CONFIG_PACKAGE_wpad-wolfssl=y

archer_a7_v5 diffconfig

CONFIG_TARGET_ath79=y
CONFIG_TARGET_ath79_generic=y
CONFIG_TARGET_ath79_generic_DEVICE_tplink_archer-a7-v5=y
CONFIG_BUSYBOX_CUSTOM=y
CONFIG_BUSYBOX_CONFIG_DIFF=y
CONFIG_BUSYBOX_CONFIG_ED=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DIFF_DIR=y
CONFIG_BUSYBOX_CONFIG_FEATURE_DIFF_LONG_OPTIONS=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE=y
CONFIG_BUSYBOX_CONFIG_FEATURE_VI_UNDO_QUEUE_MAX=32
CONFIG_BUSYBOX_CONFIG_PATCH=y
CONFIG_BUSYBOX_CONFIG_PKILL=y
CONFIG_BUSYBOX_CONFIG_WHOAMI=y
CONFIG_PACKAGE_arp-scan=y
CONFIG_PACKAGE_arp-scan-database=y
# CONFIG_PACKAGE_ath10k-firmware-qca988x-ct is not set
CONFIG_PACKAGE_ath10k-firmware-qca988x-ct-full-htt=y
CONFIG_PACKAGE_block-mount=y
CONFIG_PACKAGE_cgi-io=y
CONFIG_PACKAGE_dawn=y
CONFIG_PACKAGE_ddns-scripts=y
CONFIG_PACKAGE_ddns-scripts-services=y
# CONFIG_PACKAGE_iw is not set
CONFIG_PACKAGE_iw-full=y
CONFIG_PACKAGE_libcap-ng=y
CONFIG_PACKAGE_libgcrypt=y
CONFIG_PACKAGE_libgpg-error=y
CONFIG_PACKAGE_libiwinfo-lua=y
CONFIG_PACKAGE_liblua=y
CONFIG_PACKAGE_liblucihttp=y
CONFIG_PACKAGE_liblucihttp-lua=y
CONFIG_PACKAGE_libpcap=y
CONFIG_PACKAGE_librt=y
CONFIG_PACKAGE_libubus-lua=y
CONFIG_PACKAGE_libuuid=y
CONFIG_PACKAGE_lua=y
CONFIG_PACKAGE_luci=y
CONFIG_PACKAGE_luci-app-dawn=y
CONFIG_PACKAGE_luci-app-ddns=y
CONFIG_PACKAGE_luci-app-diag-core=y
CONFIG_PACKAGE_luci-app-firewall=y
CONFIG_PACKAGE_luci-app-ntpc=y
CONFIG_PACKAGE_luci-app-opkg=y
CONFIG_PACKAGE_luci-app-upnp=y
CONFIG_PACKAGE_luci-base=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-lib-base=y
CONFIG_PACKAGE_luci-lib-ip=y
CONFIG_PACKAGE_luci-lib-ipkg=y
CONFIG_PACKAGE_luci-lib-json=y
CONFIG_PACKAGE_luci-lib-jsonc=y
CONFIG_PACKAGE_luci-lib-nixio=y
CONFIG_PACKAGE_luci-mod-admin-full=y
CONFIG_PACKAGE_luci-mod-network=y
CONFIG_PACKAGE_luci-mod-status=y
CONFIG_PACKAGE_luci-mod-system=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-ppp=y
CONFIG_PACKAGE_luci-proto-relay=y
CONFIG_PACKAGE_luci-ssl=y
CONFIG_PACKAGE_luci-theme-bootstrap=y
CONFIG_PACKAGE_luci-theme-material=y
CONFIG_PACKAGE_luci-theme-openwrt=y
CONFIG_PACKAGE_luci-theme-openwrt-2020=y
CONFIG_PACKAGE_miniupnpd=y
CONFIG_PACKAGE_ntpclient=y
CONFIG_PACKAGE_px5g-wolfssl=y
CONFIG_PACKAGE_relayd=y
CONFIG_PACKAGE_rpcd=y
CONFIG_PACKAGE_rpcd-mod-file=y
CONFIG_PACKAGE_rpcd-mod-iwinfo=y
CONFIG_PACKAGE_rpcd-mod-luci=y
CONFIG_PACKAGE_rpcd-mod-rrdns=y
CONFIG_PACKAGE_uhttpd=y
CONFIG_PACKAGE_uhttpd-mod-ubus=y
CONFIG_PACKAGE_umdns=y
CONFIG_PACKAGE_wireless-tools=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
CONFIG_PACKAGE_wpad-wolfssl=y

So I was a little surprised when the builds turned out to be so different in filesizes:

openwrt@openwrt:~/openwrt/bin/targets$ find . \( -name "openwrt-*squashfs-*" -o -name "openwrt-*initramfs-*" \) -print0 | xargs -0 ls -ltr 
-rw-r--r-- 1 openwrt openwrt  7474692 Mar 29 23:00 ./ipq806x/generic/openwrt-ipq806x-generic-netgear_r7800-initramfs-uImage
-rw-r--r-- 1 openwrt openwrt 10354817 Mar 29 23:00 ./ipq806x/generic/openwrt-ipq806x-generic-netgear_r7800-squashfs-factory.img
-rw-r--r-- 1 openwrt openwrt  7885598 Mar 29 23:00 ./ipq806x/generic/openwrt-ipq806x-generic-netgear_r7800-squashfs-sysupgrade.bin
-rw-r--r-- 1 openwrt openwrt  6973521 Mar 30 13:28 ./ath79/generic/openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-factory.bin
-rw-r--r-- 1 openwrt openwrt  6947628 Mar 30 13:28 ./ath79/generic/openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-sysupgrade.bin
-rw-r--r-- 1 openwrt openwrt  6547637 Mar 30 13:28 ./ath79/generic/openwrt-ath79-generic-tplink_archer-a7-v5-initramfs-kernel.bin

I was especially surprised with the netgear r7800 build factory image being so huge in comparison with the sysupgrade. Any idea whether this is expected or if something went wrong in the build process ?

The changes in the configs are for the following:

1. LuCI + some bells and whistles (upnp, relayd, ddns, ntpc, dawn, themes, etc)
2. busybox: bake in some additional tools
3. iw-full
4. wireless-tools
5. arp-scan (to run on dumb AP to get hostnames of currently connected devices)
6. ath10k-firmware-qca9xxx-ct-full-htt (instead of -ct)
7. wpad-wolfssl (full wpad for 802.11k,r, and v support)

Answering my own question, looks like the latest snapshots available at downloads.openwrt.org also similar have larger than expected factory images compared to the sysupgrade files.

I'll let someone who knows that this is normal, come back on this. Better yet, anyone tried both the factory and sysupgrade files from the snapshot builds lately ?

It is "expected"...

Ipq806x factory images (like for R7800) are one unified image with kernel + padding + rootfs. That can be written with one go.

Sysupgrade is an archive file that contains kernel and rootfs separately, and the image is flashed in two steps, first the kernel and then the rootfs to the expected location. There is no padding, so the image is smaller.