Applications that Profit from the Underrated x32-ABI

last update: 2024-01-19

The x32-ABI (see Wikipedia article) is an ABI like i386 (32 bit) or x86-64 (64 bit). One can think of the x32-ABI as a 64 bit ABI with pointers reduced from 64 bit to 32 bit. In code with many pointers or much work for a garbage collector like BDW, this can reduce the memory requirement by 50 % and runtime by 10-20 %. The main disadvantage is that your x32 process is limited to 4 GB of RAM. If this is no problem for your use case, read on to get some real data for different Linux applications. All experiments were run with gcc 11.3.0 (10.4.0 for the Bigloo experiments below) from Ubuntu 22.10 on a Ryzen 7950X computer.

Emacs

The famous editor was benchmarked by compiling all .el files to .elc files using the Makefile of Emacs 28.2.

ABIrun time (s)relative to x84-64
x86-642700 %
x32255-9.4 %

The experiment was repeated for Emacs 29.1 and gcc 12.1.0 with a similar speed-up of 9.3 % (Ubuntu 22.04).

The experiment was repeated for Emacs 29.2 and gcc 13.2.0 with a larger speed-up of 11.7 % (Ubuntu 23.10).

Scheme implementation Bigloo

The Scheme implementation was benchmarked with a semantic parser for natural language processing. It involves lots of symbolic processing, large data structures, and a significant percentage of garbage collection (with the BDW garbage collector).

ABIrun time (s)relative to x84-64
i386151.7+5.3 %
x86-64144.00 %
x32119.3-17.2 %

Scheme implementation Chicken

The Scheme implementation was benchmarked with the semantic parser for natural language processing as described above:

ABIrun time (s)relative to x84-64
i386748+16.7 %
x86-646410 %
x32544-15.1 %

The 'check' makefile target of the Scheme implementation was also used as a collection of benchmarks. As this comprises compilations and the benchmarks contain many micro benchmarks and corner cases, the results might be somewhat distorted.

ABIrun time (s)relative to x84-64
i386188.2+13.7 %
x86-64165.50 %
x32155.4-6.1 %