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.
| Memory | LP64 | ILP32 | change |
|---|---|---|---|
| User-space memory (PSS, all processes) | 38.3 MB | 28.9 MB | -24.6% |
| Anonymous memory | 30.3 MB | 20.9 MB | -31% |
| Free memory (MemAvailable) | 863.6 MB | 872.2 MB | +8.6 MB |
| python3, 100,000-entry dict | 17.9 MB | 12.4 MB | -31% |
| dnsmasq, 150,000-domain blocklist | 12.0 MB | 8.8 MB | -26% |
| hostapd / wpa_supplicant | -11% / -9% | ||
| Kernel (Slab) | 28.0 MB | 27.9 MB | -0.6% |
| Time (seconds, lower is better; built with GCC) | LP64 | ILP32 | change |
|---|---|---|---|
| firewall reload with 200 rules | 2.58 | 2.84 | +10% |
| dnsmasq loading 150,000 entries | 2.96 | 3.03 | +2% |
| 20 LuCI login-page requests | 1.73 | 1.81 | +5% |
| python3 building a 100,000-entry dict | 0.38 | 0.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
- Same source, same compiler and options, same packages; only the ABI differs.
- Several runs, median reported. The QEMU scripts are in test-ilp32
openwrt/; the scripts and raw results of the hardware runs will be added. - Speed and memory are both reported, including where ILP32 is slower.