https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87316
--- Comment #5 from David <david at pgmasters dot net> --- I've isolated the compilation and the results are still as above -- new versions of gcc are significantly slower compiling the attached test.i. Using this command: gcc -std=gnu99 -O0 -c test.i gcc 7.3.0 (Ubuntu 18.04): 34 seconds gcc 5.4.0 (Ubuntu 16.04): 35 seconds gcc 4.8.5 (Ubuntu 12.04): < 1 second gcc 4.6.3 (CentOS 7) : < 1 second gcc 4.4.7 (CentOS 6) : < 1 second This has strayed a bit from the OP, but it seems to me that the time/memory consumption may be related.