ILP32
English

Benchmarks

ILP32 against LP64 for the same build: memory is the gain, a few percent of speed is the cost.

OpenWrt One hardware

OpenWrt One (MT7981B, 2× Cortex-A53 at up to 1.3 GHz, 1 GB). Two images from the same tree with the same packages (LuCI, python3-light, dnsmasq) and kernel configuration, both built with GCC 14.3; only the user-space ABI differs (the two kernels came from separate toolchain builds of the same sources). Load: 200 firewall rules, 50 static leases, a 150,000-domain dnsmasq blocklist, LuCI requests and a Python process holding a 100,000-entry dict. Three boots each, median.

MemoryLP64ILP32change
User-space memory (PSS, all processes)38.3 MB28.9 MB-24.6%
Anonymous memory30.3 MB20.9 MB-31%
Free memory (MemAvailable)863.6 MB872.2 MB+8.6 MB
python3, 100,000-entry dict17.9 MB12.4 MB-31%
dnsmasq, 150,000-domain blocklist12.0 MB8.8 MB-26%
hostapd / wpa_supplicant-11% / -9%
Kernel (Slab)28.0 MB27.9 MB-0.6%
Time (seconds, lower is better; built with GCC)LP64ILP32change
firewall reload with 200 rules2.582.84+10%
dnsmasq loading 150,000 entries2.963.03+2%
20 LuCI login-page requests1.731.81+5%
python3 building a 100,000-entry dict0.380.42+11%

The kernel is LP64 in both images, so kernel memory does not change; the savings are in the programs and grow with their data. An idle router saves only a few hundred KB. Most of the time cost comes from handling 32-bit pointers in 64-bit code, and more in code with fast paths written for a 64-bit long. With the busiest packages (ucode, lucihttp, json-c) of the ILP32 image built with clang instead, the firewall reload took 2.63 s (+2%) and the LuCI requests 1.76 s (+2%), with the same memory (same OpenWrt One, three boots, median). The LP64 image was built with GCC only; LP64 with clang has not been measured, so part of this gain may come from clang itself. The same test in QEMU (armsr, 256 MB) gave -26.0% user-space memory and +9.6 MB free memory.

CPython on Cortex-A35 and Cortex-A53 boards

The same CPython build recipe for LP64 and ILP32: ILP32 uses about 30% less memory and is 2.6% slower on the Cortex-A53 and 5.7% slower on the Cortex-A35. Builds, flags and per-benchmark numbers: llvm-ilp32 docs/benchmarks.md.

How we compare