qmk / qmk_distro_msys

A Windows one-click installer for the QMK CLI
https://msys.qmk.fm/
GNU General Public License v3.0
188 stars 69 forks source link

Investigate potential ways to improve compile times #23

Open zvecr opened 3 years ago

zvecr commented 3 years ago

Description

Benchmarks performed on a 4970k, default lets_split compile,

$ time make clean lets_split:default

real    0m39.616s
user    0m8.838s
sys     0m18.854s
zvecr commented 3 years ago

Good example of where git calls slow down,

$ time SKIP_GIT=true make clean
Deleting .build/ ... done.

real    0m0.395s
user    0m0.060s
sys     0m0.136s

# cold start
$ time make clean
QMK Firmware 0.11.53
Deleting .build/ ... done.

real    0m36.582s
user    0m0.745s
sys     0m8.254s

$ time make clean
QMK Firmware 0.11.53
Deleting .build/ ... done.

real    0m6.728s
user    0m1.787s
sys     0m5.169s

$ time SKIP_VERSION=true make clean
QMK Firmware 0.11.53
Deleting .build/ ... done.

real    0m0.550s
user    0m0.121s
sys     0m0.213s

clean fetches git state to create version.h, throws that away as it doesnt need it and just removes a folder.

Generating the version file seems to be the main culprit of the SKIP_GIT=no slowdown.

zvecr commented 3 years ago
$ time SKIP_GIT=true make -j$(nproc) --output-sync clean lets_split:default

real    0m12.819s
user    0m5.240s
sys     0m13.298s

Default environment to SKIP_GIT=true and MAKEFLAGS="-j$(nproc) --output-sync"?

zvecr commented 3 years ago

Force util/list_keyboards.sh to only do

echo "lets_split/rev2"

Results in,

$ time SKIP_GIT=true make -j$(nproc) --output-sync clean lets_split/rev2:default

real    0m8.457s
user    0m4.090s
sys     0m10.041s