# Linux Kernel Module Cheat

##### 35.2.3.3. Benchmark gem5 build

How long it takes to build gem5 itself.

We will update this whenever the gem5 submodule is updated.

All benchmarks done on 2017 Lenovo ThinkPad P51.

Get results with:

    ./bench-all --emulator gem5
    tail -n+1 ../linux-kernel-module-cheat-regression/*/gem5-bench-build-*.txt

Ubuntu 19.10, GCC 9.2.1, LKMC 7c6bb29bc89ec3f1056c0680c3f08bd64018a7bc, gem5 d7d9bc240615625141cd6feddbadd392457e49eb (2020-02-18), `./build --arch aarch64 --gem5-worktree master --no-cache`: 19m 33s TODO must investigate why it got so much worse.

Ubuntu 20.04, GCC 9.3.0, LKMC 6275f70ed8862d8fe4e58ca4524a6994d254be35, gem5 d9cb548d83fa81858599807f54b52e5be35a6b03 (2020-05-06), `./build --arch aarch64 --gem5-worktree master --no-cache`: 28m!!! It’s out of control.

Same but gem5 d7d9bc240615625141cd6feddbadd392457e49eb (2018-06-17) hacked with `-Wnoerror`: 11m 37s. So there was a huge regression in the last two years! We have to find it out.

A profiling of the build has been done at: https://gem5.atlassian.net/browse/GEM5-277 Analysis there showed that d7d9bc240615625141cd6feddbadd392457e49eb (2018-06-17) is also composed of 50% pybind11 and with no obvious time sinks.

- pybind11 accounts for 50% of gem5 build time

- Benchmark gem5 single file change rebuild time